It's worth writing down everything he's been into when he has a bout of diarrhea. I did this with my male who often got diarrhea and it was an eye opener. I discovered he gets the runs with turkey and chicken (no great surprise) and when he eats dirt! So nowadays I avoid products with poultry, and more importantly, as soon as I see his mouth heading for the dirt he gets stopped. He hardly ever gets the runs now (just when he's eaten crap off the ground before I can stop him)
I cook one meal for my dogs, but with the other, like Ann I have them on a limited ingredient food (Wellness). For a dog with sporadic tummy issues I think it helps and will give you a better idea of what is causing the problem.