In order to stop sweat stains before they ever happen, there are a few things you can try. The first thing you need to realize is that it's not really the sweat that causes the stain. Sweat is clear and on a clean shirt, you won't get any worse than some white salty residue on occasion, which comes out in a regular wash cycle. The real culprit here is the combination of that moisture with the deodorant or antiperspirant you're using. Even a clear gel deodorant can leave stains if you don't take the proper steps.
The reason why you get the sweat stain is because of a misapplication of your underarm product. The majority of the stain comes from putting on too much deodorant and throwing on your shirt before it has a chance to dry. You're basically coating the underarm of your shirt with a layer of wet deodorant that will dry into a thin crust before becoming moist again from your perspiration. You're dead in the water. The trick is to only use a single thin application of the product. There's no evidence that applying more works better at stopping sweat or neutralizing body odor. As long as you have appropriate coverage, it doesn't need to be globbed on.
The next thing you need to do is let the deodorant or antiperspirant dry completely. We mean really completely. This may mean parading around the house with your shirt off, flapping your arms like a farm hen. So be it. We're talking the end of sweat stains, so it's a small price to pay -- just build it into your morning routine.
There are a couple of other things you can try in addition to this if you want to prevent sweat rings from happening. Dress shields have been around for a long time and do a good job at preserving the underarm area of your shirt. These soft cotton, disposable pads can be stuck to or sewn into the underarm of your shirt to soak up excess perspiration. And there's a company in Switzerland has invented the "Laulas Let It Flow T-Shirt" that has a built in pocket for stuffing toilet paper to do the same job. If you don't like the idea of either of these extra steps, you should just go easy on the deodorant and antiperspirant and allow it to fully dry before you dress.