S.H.
4 months of potty training is not much.
He has not yet "mastered" it yet.
Pooping, in a toilet, is often attained after peeing. In time.
Just don't pressure him or a child may start to on purpose "withhold" pooping altogether... which will then cause constipation and pain when they can no longer hold it in. Then when they poop, they will be constipated and it will HURT. Then because it hurts, they will withhold pooping more. Then a vicious cycle arises. And the more constipated they get, the harder it is to undo it.... sometimes taking months. It then becomes a 2-pronged "problem"- emotion based because it hurts, and then medical based because the child is constipated.
I learned all this because we had to take my daughter to a Pediatric Gastroenterlologist, when she was learning to potty. We didn't force her... but the process just caused her anxiety. It took months, just to undo the constipation and her anxiety about it all.
Him pooping in a diaper for now, is fine. That is what the specialist told us. When the child matures and gets past this stage of pottying.. they will go in a toilet. It is just not by "our" adult time-line of expectations.
It is not him being naughty or stubborn. The body/mind connection also has to mature.
all the best,
Susan