To create a mix for mastering with proper headroom is pretty simple.
In mixing, never let your levels go over 0db on ANY of your individual instrument or vocal tracks. If you do this, 99% of the time you will be under 0 level on the stereo/main out meter, which leaves you some headroom (not necessarily +3db or more but at least +1db). Don't compress your tracks heavy and you'll have adequate dynamic range too.
That's usually all you need to do to achieve proper headroom, but there are always exceptions. If most of your tracks are hot and peaking right at 0 level, your song mix could be at 0 level with no headroom. It won't be distorted (if not recorded distorted), but you still won't be leaving the audio mastering engineer much to work with. If this is the case, after finishing your mix, link all the channels together and just pull them all down a few dbs. Now you have headroom.
Remember, loudness maximization is done in mastering not mixing. DO NOT keep raising your faders way over 0 level in an attempt to match the volume level of your favorite song. This will distort it. Yes, you matched the volume level, but now you have a scratchy distorted mess!