The best/easiest way is the way the military now does it.
Wrap the gun in a couple of sheets of vci paper and seal in a special plastic bag.
Then if you want you can seal in a plastic tube to protect it from getting banged around.
The paper gives off a vapor that drives out moisture and surrounds the gun with a vapor that totally prevents rust for at least 10 years.
You do HAVE to use the special "hard" plastic bags because these won't pass moisture and allow the vapor to escape.
All standard plastic bag will pass moisture and air.
Best, if you want to use the gun all you have to do is open the bag and take it out.
To store, apply a thin coat of a good lube like CLP Breakfree to neutralize fingerprints, wrap with a few sheets of the paper and tightly seal in the special bag.