E.A.
It's called encopresis, I have a son with it. Your son needs to start sitting on the toilet after each meal as a matter of routine. He's a little young to start the Miralax/Glycolax stool softener. Rewarding for pooping is one thing they actually suggest for this condition, but NEVER NEVER punish for it.
These kids cannot control what is happening. To learn more about it go to: http://www.aboutencopresis.com/ Luckily your son is still young enough that if you start regular "sits" after meals, you can probably avoid the worst. Unfortunately you will be hard pressed to find a doctor who will diagnose at this young age, so go read the suggestions at the website I posted to (there's a discussion/support board there too)and find out what you can do about this right now. It will not go away on it's own, it will only get worse. Work together, be his partner in this. It's scary for them. Good luck.
Anyone is free to message me to talk about this. My son is almost 9yo and it took us three doctors and 5 years to get the correct diagnosis. He is healing, but it will take years of the meds and behavioral training for him to be totally well again.