You can check with your vet about this but usually it is not advisable to give a dog a medication to slow down digestive movement when there is intestinal infection as that allows the infection to build up in the system instead of being expelled as it normally would be.
Imodium actually slows the intestinal actions.
You can however give a bland diet instead of regular food. I would suggest trying boiled chicken meat or hamburger with the fat drained off, mixed with really well cooked rice in a ratio of 1/3 meat to 2/3 rice to see if that works. It's not a balanced diet but OK to use for a few meals while working on controlling digestive upset. Once the dog is feeling better you slowly reintroduce the dog's regular diet adding a little more each meal.
You may find that will help with the stool being less liquid as the rice fiber helps absorb the fluids making stools more formed.
Hope this helps you!
Pet Health Care, Rescue,Train,Breed
30+yrs pet vet care & nursing, rescue, behavior & training, responsible breeding, small animal care