Possible ideas to try immediately:
1) First and foremost, keep things clean. Pick up after your dog immediately. Don’t give him the opportunity to wonder how that fresh, enticing piece of dung tastes.If you have other pets, clean up after them right away, too – especially litter boxes. In other words keep temptation at bay by keeping the stool away.

2) Keep your dog mentally and physically engaged. Make sure you give him regular playtime like fetch and if he’s particularly energetic or a working dog, try something like agility or some other brain-stimulating training. And make sure that he has plenty of toys available to help keep him entertained.

3) Make sure he’s eating a raw, whole, varied diet of quality proteins. Raw food has those digestive enzymes your dog needs to help him process his meals. If you’re feeding cooked food only, you’ll definitely want to add digestive enzymes. Raw, green tripe is particularly high in digestive enzymes, as well as probiotics.

4) For a trace mineral deficiency, you can add some kelp, according to Dr Demers. And for a hydrochloric acid deficiency, try some apple cider vinegar (1 tsp per 25 pounds in food), which may help mimic the missing acid and help the body compensate for the deficiency, according to Dr DeHaan. Learn more about the health benefits of sea vegetables like kelp, here.

5) heck your dog’s stool regularly for parasites.

6) Avoid punishment, because according to a study at University of California, Davis involving 1,500 Internet surveys of pet owners, it is ineffective. The study also found food additives used to stop poop eating are only effective up to 2 percent of the time. Positive reinforcement training wasn’t very effective either.

7) Keep on top of the digestion situation of all the pets in your household. Remember, your dog may be attracted to another dog’s or cat’s stool, not only because he is deficient in something, but because they are not absorbing their food and their poops are extra enticing.

8) Gross as it is, the act of stool eating may be somewhat complicated. If your dog starts nibbling on poop, look for medical causes and if he’s clear of issues, then make sure to keep things clean, your dog engaged and well fed. Be patient and be consistent.