Hitting an exact file size
The control
Turn on Target file size and enter your limit in Target size (MB). The program works out the bitrate that lands the output at that size and encodes to it.
It is also available as part of a saved preset, as Maximum file size in MB, so a limit you hit often can be one click.
The arithmetic
File size is bitrate multiplied by duration. Nothing else.
Eight megabits per second for sixty seconds is 480 megabits, which is 60 megabytes. If the limit is 8 MB for a minute of video, you have about 1 megabit per second to spend, and no encoder setting on earth changes that.
So when the target cannot be met at a quality you can live with, the program is not failing. The arithmetic is.
What to give up, in order
Length. Cheapest by far. Half the duration is half the file at the same quality. Most pieces that will not fit are also too long.
Resolution. Drop Output height from 1080 to 720. At a tight bitrate, 720p looks considerably better than 1080p, because the encoder has enough bits for each of the pixels it does have rather than not enough for any of them.
Frame rate. Going from 60 to 30 is roughly a third off the bits needed, and on anything that is not sport nobody will notice.
Noise. Compression cannot predict randomness, so grainy footage at a fixed bitrate looks worse everywhere, not just in the grainy parts. Cleaning the source up first buys you real quality at the same size.
Quality. Last, because by the time CRF is doing the work alone, the picture is already falling apart.
Audio counts too
At a tight limit the sound is a meaningful share of the file. Dropping a spoken word track from 192 kbps to 128 costs almost nothing audible and gives those bits to the picture. Going mono halves it again.
Leave a margin
Containers add overhead, so an encode aimed exactly at the limit can land just over it. Aim a few percent under whatever the hard number is.
When the destination re-encodes anyway
Every platform re-encodes what you upload. If the limit is an upload limit rather than a delivery limit, give the platform the cleanest file that fits and let its encoder do the reduction. Matching its output bitrate yourself just means it compresses an already compressed picture. See Getting it out the door.