This may be due to intestinal upset from any change in food, intestinal parasites such as worms, coccidia, or giardia. Intestinal parasites are one likely thing to be bothering him. You can bring a fresh stool sample to the vet to be checked (yes even the mucous) so the vet can give the right worm meds, or antibiotics if the problem is a protozoan infection, such as coccidia or giardia or campylobactor. This could also be due to a swallowed non food item which is a pretty common thing for pups to do, ingestion of something toxic including plants, mushrooms, chemicals etc. So seeing the vet in person with the pup to find out what is going on would be a good idea. For home care you can add some plain pedialyte to the water bowl to help with hydration. You can also see if bland food will help your pet feel better. 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. The fiber in the rice will help bind up fluids.
I find using the pedialyte and the bland diet along with the meds from the vet helps a dog out a lot and that you can slowly get the dog back on a regular food diet as it feels better. I would not use any over the counter anti diarrhea medication as if this is from a bacterial infection you do not want the bowels to slow that much until the bacteria is treated. If home care isn't helping him then I'd suggest seeing your vet for a stool sample check, abdominal palpation or x-ray etc.
Hope this helps you!
Thank You Nancy,
Your information was very helpful. I didn't know you could give a dog pedialyte. My dog is doing better he has been on some medicine flagyl for a week. He seems happier. So it must be working. They tested his stool and that was fine.