From my understanding there is only 2 things that have to be done for Stout to be the one that survives the whole 'mole hunt' arc; and one of those things can be completed or not completed without players realizing it depending on how OCD they are in their gameplay style.
1. The Maelstrom meeting HAS to end in violence in some way. Obviously Royce has to die, either via dialogue exchange, or by the boss version you encounter before exiting the Allfoods plant. (The Militech chip can play a part in how some of this plays out, but what's important is that Royce dies.)
2. The one thing that is less obvious; a e-mail has to be read on a certain computer in AllFoods; it's located in a small room directly across the walkway from the area you drop into from the vent you crawl into after climbing the ladder via the Maelstrom meeting that goes wrong.