Thanku for your query,
Well I understand your concern ,according to me it seems your baby is having gastroenteritis
.it is mostly viral .but as it is a repeated infection you need to get a stool routine done to rule out some parasitic or bacterial involvement.
For gastroenteritis u need to keep baby properly hydrated with ors
and fluids .avoid giving milk and juices for few days .give soft diet
easily digest able ,also give some probiotics for 3 to 5 days and zinc supplementation for 10 to 15days.
Do remember to do deworming once baby gets well .
I hope I answered your query