Need help with my toddler

So my 2.5 year old just started to take off his diapers once he poops in them. We have and are trying to potty train him. He knows where he’s suppose to go, but won’t do it. He will sit on the potty and pee but for him to go when he’s gotta poop or pee, it won’t happen.