Diarrhea

My baby had a bug a couple days ago but the diarrhea is sticking around. His doctor said to make sure he's hydrated but how long is it supposed to last? 🤦‍♀️ He's starting to get a rash from it!