Although most people find it repulsive, it is quite natural for dogs, especially puppies to eat feces. (Feces found in kitty's litter box is an especially favorite treat.) Fresh feces closely resemble the first solid food the puppy ate: warm, semi-solid, semi-digested food that mom regurgitated for her pups to eat.
Often this behavior will just go away when the pup matures. In the mean time, keep the pup's toilet area as clean as possible. Be sure that the puppy is checked for worms and other possible problems such as something lacking in the dog's diet. It is a good idea to have the dog's diet approved by your vet, or switch to a nutritionally complete dog food sold by your vet or pet store.
Many owners have had success in stopping this behavior by supplementing their dog's diet with one spoonful of canned pineapple or a teaspoon of spinach. There are products on the market such as 'Forbid' that can also be added to the dog's food to help stop the problem.
If the dog is still fond of feces, try teaching your dog not to touch it using the command 'Off.' Put your dog on leash and walk him by some feces. If he shows any interest in it, tell him, 'No, off.' If he continues to go for it, then loudly scold him, 'OFF!!!' and pull him away from it with a short, sharp tug on the leash. When he stops, praise him. Continue walking and keep returning to different piles of feces over and over, repeating the off procedure until he gets the idea that you disapprove of his dietary interests. Whenever he shows no interest in the feces, be sure to tell him how happy you are through praise and reward.
It is also possible to make the feces unappetizing by sprinkling them with hot sauce, lemon juice or anything the dog finds distasteful. Some dogs like hot sauce and will consider it a garnish, so find out what your dog does not like before using it.
Be sure to clean up your dog's feces immediately after he defecates so as to prevent the problem in the first place. Do not give him the opportunity to indulge himself.