It's been many months since you first posted this message, and I'm wondering how it's going for you.
I have an almost 4 yr old boy who is in underwear, has very few accidents with pee, but will not poop on the potty. He won't even poop in a pull-up. He goes in his underwear, and then I make him stay in the bathroom while we we clean up the underwear and the sink, then we get him dressed again.
My first son had some trouble with pooping too, but he knew when we put on his pull-up for naptime that this was his chance to do it. We had some trouble with him playing with his poop, but I think for him it was mostly that he didn't like it all over his bottom. So with him I explained that going in the potty meant he wouldn't get it all over his bottom, and the first two successful times in the potty we went to the store and got a Thomas train. That worked for him.
But my second one is very stubborn and doesn't want to be told when to go. It's so frustrating!!