Do you know why he won't poop in the toilet?
Is he afraid he might fall in? Does he have the proper potty chair? Does he not like the splash that a poop might create?
Start with his reasons and then be patient. I do not recommend making him sit "forever" until he goes. Some kids hold their bowel movements, causing their intestines to enlarge and you don't want this either. So, be patient.
Still, be consistent. Every single time he poops NOT in the toilet, undress him, take him to the potty, make him sit and then explain to him why it's important to let it go. There are some books (Everyone Poops by Taro Gomi) or you can show Youtube videos of Elmo, etc. potty training.
When he DOES poop in the toilet, give a reward like a sticker or favorite item. With my oldest son, we bought a bunch of Tonka Trucks (the small size) and put them in a clear plastic container. Every time he used the potty, he got one! Then, when he did not go in the potty, we took a truck back. The plastic container has to be clear so he can see the trucks. You can also use a reward chart.
Really, the most important thing is for you to observe your son and find the REASON behind his apprehension and then for you to be CONSISTENT and PATIENT. Like my son's pediatrician told me "He won't be in diapers when he's 10 years old, so just give him time."
Good luck!