M.P.
His body is most likely not mature enough to let him know ahead of time that he needs to poop. The fact that he has 2-3 times may be an indication that his body is maturing but then again it may have just been coincidental that he was on the potty when the poop came out.
He may also be unconsciously not using the potty because he feels pushed to do it. Or, because him using the potty is important to you he is feeling overwhelmed. There are several scenarios that could be causing him to be unable to use the potty.
I would back off about insisting that he poop in the potty. I'd tell him that you know that he'll start using the potty when his body is ready to do it. Give him control of when he poops.
In the meantime do take him to the potty at times he usually poops so that he is able to equate those times with pooping. This may also clue him into how his body feels. I'd just not insist that he poop. You're giving him the opportunity.
Relax and it will happen. Our babies' bodies mature at different rates. Many become potty trained without the parent making much of an effort.