I want to paint the 2 x 4 and inside of the wall and ceiling to a shed in my back yard. To seal out moisture to keep it from rotting out. My son said if I painted it, this would seal out the air so it would cause the wood to rot.
There is nothing wrong with painting your sheds interior as long as the exterior is properly sealed and it has a good non-leaking roof.
If there is visible water stains on the framing or floor or you have noticed moisture then painting will accelerate the rotting of the wood by trapping this moisture.
Karl is correct in his answer to this , I would just add that if there is signs of water or moisture damage it is easily fixed, first seal the exterior by caulking any gapes, second open the door or doors to the shed and let air out (sunny days only) or place a space heater in side. Third once it's dried out spray bleach on all water stains or mold areas and let dry. Finally prime with Kilz original or a white shellac, then paint.