Eating excrement, or coprophagy, is a fairly common problem. The theories as to why dogs eat poop range from diet deficiencies to being hungry to boredom. Bottom line is, if your dog is eating poop you want him to stop.
Some say sprinkle hot sauce or some other substance on the poop to make it less attractive. That's fine if you want to, but since you're already there at the poop site, how about picking it up so it is not available to eat?
Meanwhile, watch your dog when he has opportunities to eat poop. Catch him about to eat it and stop him! Tell him NO or startle him in some other way before he takes a bite. Then remove the poop. Keep monitoring him.
Eventually the dog will stop eating poop, just like he stopped other behaviors after you taught him those behaviors were unacceptable.