Potty training

Potty training

Hi my 3year old son has been perfect at peeing in the toilet or potty BUT he will not poop in the toilet ONLY in his nappy so I have tried to remove nappy for even two days but he holds it in and becomes constipated. I have tried everything please help, he only poops standing up I don't know what more I can do to encourage him it's been stressing me out sooo much I can't sleep at night please someone help me !