Search the forums here

it's an often-asked question.
I'm afraid that poop eating is something of a fact of life with dogs. It should be discouraged though, because it is a great way of spreading parasites and other nasties.
There isn't a whole lot you can do, other than stopping them when you catch them in the act, to prevent a dog from eating others' poop. With cat poop, you need to put the litter tray where the dog can't get to it.
As for why he eats it at all - well, I don't think that anyone can answer that for certain. One theory, that I think has some validity, is that there is plenty of protein and other 'goodness' in the poop that the dog finds attractive. That is especially true when the animal is fed a food with lots of fillers and unuseable proteins - being undigestible, they are expelled in the waste and hence the waste is attractive to eat.
So you can reduce the likelihood of your dog eating his
own waste by feeding him a premium food. The ingredients are more digestible, meaning there is less 'attractive' stuff expelled in the waste. So you could ditch the Science Diet - it's loaded with fillers. Better yet, feed him a raw diet. That is almost completely digestible and I have never (yet) heard of a raw-fed dog eating its own waste.
If none of that works, there are products you can buy in petstores that are supposed to make the poop unattractive to a dog. Doesn't work in all cases, but it does for some. Of course, that would only apply to his own poop - you still have to rely on vigilence to stop him eating the poop of others.