Apple will send you an email with a content code for the Mac App Store after purchasing one of the older operating systems.
"Redemption codes are usually delivered within 1 business day but may occasionally take longer."
Once you have the redemption code simply click Redeem from the Quick Links in the Mac App Store.
If you want to create a USB install key you can follow one of these tutorials:
● How to Create a Bootable OS X Mountain Lion USB Install Key
● new=true]How to Make a Bootable Mac OS X Lion USB Install Key [Video]
[Mountain Lion] [Lion]