There are several ways to prevent white spots in the stool:
Feed your dog a healthy, balanced diet: This will help your dog get a range of nutrients and hopefully avoid as much undigested food as possible.
Switch to non-capsule medications: You may be able to digest them more easily.
Maintain good hygiene: This includes washing regularly and keeping nails short of warding off parasites.
Adhere to a gluten-free diet if your dog has celiac disease.
Feed your dog a low-sugar diet if you know he is susceptible to Candida. Treat any external infections immediately.