Rust, or ferrous oxide, is formed when iron or iron-containing steel is exposed to oxygen. Even galvanizing, which coats iron or steel with zinc, prevents rust only if the coating is not scratched or worn off. Formation of ferrous oxide is enhanced by the presence of water, which makes pipes most vulnerable to rusting, although any metal exposed to air, like garage door hinges or metal casement frames, can also rust.
When rust appears on a metal surface, it needs to be completely removed for priming and other painting to be effective. Sanding by hand or using a power sander (along with safety glasses and gloves) is the best way to remove rust down to bare metal. Thorough removal is critical to prevent the return of rust. Any measures that will lessen the chances of new rust formation, like taping pipe joints, should be done at this time. One manufacturer of rust-inhibiting paints recommends using soap and water or tri-sodium phosphate, rather than other household cleaners, to remove oil, grease, loose paint and other contaminants in addition to rust. Failure to remove oils can result in paint dimpling, called fish-eyes, in primer.
Oil primer is well known for thorough coverage and the impenetrable hard surface typical of all oil paints. Especially if it contains rust-inhibitors, it will create a solid barrier between metal and air. However, oil primer is subject to cracking. On a surface such as a heating pipe, subject to frequent expansion and contraction, oil primer may develop small fissures. This suggests that oil will be more effective when you need to provide a barrier between dry metal and exterior moisture, for example, on a mailbox or outdoor furniture. Oil primer is essential when your planned topcoat paint is also oil based.
Latex primer is slightly more elastic and permits water vapor to pass through. Latex primer, therefore, works well on interior surfaces with variable moisture and should also be considered when exterior walls blister because of trapped indoor moisture. One manufacturer recommends latex primer for exterior spot priming of nail-heads in new construction, followed by a coat of latex primer. You should always remember that oil-based primer can go under both oil-based and latex topcoats, but latex primer is not recommended under oil-based topcoat paint.
Although less often used, shellac-based primer is the recommendation of some professionals for rust stains. Quick-drying, this very hard surface will prevent any moisture from reaching rust-prone surfaces. Requiring denatured alcohol as a solvent, shellac primer can be challenging and is prone to brittleness.
For solid and durable coverage, oil-based primer remains an excellent choice to cover rust in situations where metal needs protection from exterior moisture. More adaptable to varied topcoats than latex or shellac primer, oil falls short only in areas where trapped interior moisture may cause blistering or frequent surface expansion and contraction promotes cracking. When causes of rust are unclear, oil primer is a logical first choice.