Fixing rust on my 1973 Mercedes revealed two previous rust repairs. One was done decently professional (it lasted almost 10 years), the other very amateurish (lasted 3 years). This helped me to see what works and what doesn't when doing rust repair on your car.
1. Not understanding moisture
You probably know that rust forms when bare metal is exposed to moisture but probably don't know the moisture doesn't come only from the OUTSIDE of the car. For instance, when it's cold outside and your car's heater is on (see the cross-section of rocker panel above), the moist warm air inside touching the cold metal condenses on the surface. The gravity pulls those moisture droplets down into all sorts of crevices and you have a recipe for rust formation. You have to think about moisture finding its path into crevices outside of the car but also inside.
2. Overlapping the joints too much
I bet when as young child you played with LEGO you've learned that large overlaps make the structure more sound and solid. Unfortunately, our cars are not made out of plastic but metal and metal has different properties than LEGO's plastic. Besides the obvious differences, metal rusts and so it's imperative to help preserve the car's structure by making the lap joints as small as structurally possible. Why? Overlaps attract moisture and the larger the overlap, the harder it is for this moisture to evaporate.
3. Not wire-brushing welds
When you weld, the joints get covered with all sort of gunk. This gunk must be wire-brushed away so when your put some paint to protect from rust forming, it has good adhesion properties.
4. Not protecting bare metal with paint / Using wrong product as rust-preventive
Let me state it simply: bare metal rusts very easily. It starts flash rusting within days if not hours and can succumb to rust within a year or two. It must be protected by introducing a barrier between metal and the moisture from the air. Paint acts as such barrier. You MUST protect metal in some way or it will rust away.
The paint acts like the easiest barrier material but not all paint is created equal. For example, don't assume that porous primer will save your metal. Its function is to prepare surface for paint adhesion rather than protect the surface from moisture (thus rust). Cover your primer with paint that won't be porous. In general (be ready for a very broad statement), shinny paint tends to create good barrier. This paint, in turn needs to be protected from chipping away. On parts of the car that are exposed to road debris - the car's under-body and the inside of wheel arches - you can apply rubberized undercoating to act as a soft barrier between rocks and the paint. Please understand, rubberized undercoating is somehow porous so it WILL let moisture penetrate to the bare metal if left unprotected. In other words, undercoating on bare metal will lead to rust probably sooner than one anticipates.
5. Not protecting joint with seam sealer
Your welds are never perfect - especially when you are just starting out - so it's imperative to protect your welds from rusting. After wire-brushing them clean and grinding away excess welding material you should clean your surface with parts cleaner to rid your work of any contaminants, then spray it with paint. When it's all done, seal it with seam sealer so the weld's imperfect surfaces don't create crevices that could trap any moisture.
6. Not preping the edges properly
When you cut metal, the edges are sharp or left with chips. Those small pieces will rust away quickly or hang loose preventing the edges from properly accepting the paint. This, in turn will lead to rust. Moral of the story, polish the cut edges to rid the surface of metal chips and shavings.