Hi again M.,
My son was the same way.
He was doing great with peeing in the potty, but at nearly 4 years old he was still hiding in his closet to poop in his diaper. Refused to poop in the potty.
The pediatrician said boys are really notorious for being grossed out or embarrassed about pooping. He said it's common.
All I can say is patience, patience, patience.
Reward any successes with lots of praise, and any other reward you want, but don't say much at all about the "failures". Just show mild disappointment, but encourage him with something like "Well, you'll get it next time I bet". No scolding, or punishment, just an "Aw well, gee, that's too bad" attitude.
He'll get it eventually.
I don't remember when my son finally "got it", but he is now 25 years old, married with kids, and I am pretty sure he doesn't poop in closets any more !!! LOL !
Seriously, I know for a fact he had been completely potty trained long before he went to kindergarten.
Hang in there !
OH ! One other thing ........ he seemed to hate the potty chair, so we got one of those little seats that fit onto the big potty. It had a Snoopy back on it, and he was nuts over Snoopy. He seemed to like the "big potty" a lot better. Maybe something similar will help you ?
Best wishes.