When a baby comes down with diarrhea it's always such a worry since they can dehydrate so quickly. The best home remedy I have found for diarrhea in infants is using 7UP kept at room temperature. If you let it sit and allow the fizz to go out it can be put into their bottle. Mashed banana are also excellent, since it will also give the baby the needed vitamins and electrolites. If the baby is very young put a bit of formula or spring water in the banana to make it liquidy and just put a tiny bit at a time in their mouth, a tiny bit goes a long way for a baby.
If the diarrhea is severe I have always boiled brown rice with extra liquid then strain the rice and put the broth from the rice in its bottle or a sippy cup. This is also really good for babies and easy on their digestion system.
One of my sons had terribly severe diarrhea when he was a baby (he's 38 years old now), we discovered he had an allergy to milk, at that time that was all we had for formula. I put him on the 7UP and banana diet for long periods of time and his diarrhea would completely clear up, and his Dr. couldn't get over how healthy he was. I also used the brown rice broth when he was thirsty.
Check your baby's formula to see if you may have to change it. You have much better options these days. Diarrhea and colic are usually the first signs of a food allergy.