Sounds like he is having constipation problems. Give him lots of WATER, fruits and vegetables, whole grain foods. Limit or eliminate white bread and things like saltine/ritz crackers, etc. It expands in the stomach and is very sticky in the intestines.
I would just leave the whole potty training thing alone for awhile until you get his constipation under control. Giving him laxatives on a regular basis will just make things worse in the long run because you are actually relaxing the muscles he needs to push so you start messing with his natural abilities to eliminate.
You can explain to him that eating certain foods make it harder for him to do a poop, he is old enough to understand and may help him transitioning to new foods. Keep trying different things. There are so many different kinds of fruits and vegetables and can be made so many different ways.
Also, fruit juice pops made from juiced fruits not anything store bought with lots of sugars/additives, etc. My kids love the fruit pops and its a good way to get more fruit/liquid in him.
Good luck and just learn as much as you can from searching the internet and the library. There is alot of effect the foods we eat have on our body just a matter of how much we are willing to re-learn to avoid those problems.