My son is in almost the exact same boat. I will pass along what I have learned from my next door neighbor, who has three children, with the youngest about 6 months older than my son.
It is great that he is doing so well with the pee in the toilet! It is very common for them to not poop in the toilet yet even if they are peeing in the toilet. The potty training often comes in 3 phases: 1) peeing in toilet; 2) pooping in toilet; 3) keeping dry at night and being able to wear undies at night. Your son has mastered phase one!
First of all, what he is doing (hiding when he poops) is not "wrong." Do not chastise him for it. He probably feels that pooping in ANY environment is wrong, and this is why he hides it. Until he feels better about pooping being ok (whether or not it is in his diaper), he will be unlikely to poop "out in the open" on the potty.
To help him get over the stigma of the poop, take the poopy undies and say "great! you went poop! Let's take it to the potty where it belongs!" and have him help you put it in the potty or toilet and flush it down.
Then suggest that he might want to poop in a diaper or in the potty when he needs to, so that he can keep his underwear clean. This would be an appropriate time to use Pull-Ups even if you have not used them for potty training, because he can run and change into the pull-ups himself, and then poop, and then go back to underwear.
My son has started asking for a diaper when he needs to go poop, and I think this is great! As soon as the diaper is on, he goes somewhere alone to poop and then asks me to wipe his bottom and give him underwear again. He got to this place after a few "accidents" in his undies, and I suggested that he might like to poop in the toilet or a diaper instead of underwear.
And guess what, even after they are fully potty trained, you will still have to wipe their butts for a long time.... Fun times!
Good luck.