We went through the same thing with my daughter. She was almost 4, but still wouldn't poop in the potty. She would ask for a diaper- I had to keep some on hand just for that. Bribery worked for us. We told her if she pooped in the potty, we'd go get ice cream. Every time she asked for a diaper, I'd remind her that if she pooped in the potty, we'd go get ice cream. But other than that, I totally did not harp or nag or anything. One week later, success! Of course it was 10pm, but we did absolutely run right out to Brusters and get ice cream. She still used the diapers, but started using the potty, too, and we would go get ice cream every time. As the frequency increased, we weeded out the ice cream reward, and soon we were diaper-free. The whole thing took less than 2 months.
If he is happy pooping in a diaper, don't hold out on him. I tried just not putting a diaper on my daughter, thinking she would use the potty out of necessity, but she just held it for a week at a time and wound up constipated. Talk about counterproductive.