The best thing that you can give him is some canned pumpkin. Just add 1 tsp to his next few meals and this will have a gentle stool softening effect. If your dog is large, you can even give a little more.
If this does not work, you are dealing with a bigger issue and will need to see your vet.
Let me know if you have more questions.