If you/parents are cleaning him up afterwards, there's no incentive for him not to poop in his pants. He's clued in that the younger children don't have the inconvenience to stopping their play to go to the toilet and just soil themselves and therefore, he's up for that. It's way better than missing out.
So while using the toilet is less convenient than soiling himself, you have to make it so soiling himself is the biggest inconvenience of all.
He needs to retrieve his fresh clothing from his bag. He needs to undress himself. He needs to get cleaned up (with you help as is age appropriate). He needs to put his soiled clothes in whatever he's taking them home in. He needs to get his fresh clothes on, wash his hands etc before being able to rejoin the activities. You and parents need to limit the assistance you give with this to just what is necessary to ensure you don't have poop falling from his soiled clothes all over your house. Don't hold open his fresh underwear/pants for him to step into.
No negative comments but you do need to have the conversation that going to the washroom is quickly than all the malarkey of cleaning up an accident. Make sure that the activity going on while he's getting cleaned up is something he would love to be participating in. He has to understand that the only reason he's not playing at the moment, is because he's soiled himself and so until that's sorted out, he isn't available to play. And it's his consequence - not yours, to freshen up. If he was fully toilet trained and if there hasn't been a major event at home (new sibling, parent working away) then it's fully a choice he is making and we all have consequences to our choices.
Having Mom and Dad on board and taking the same approach will shorten the time it takes him to grasp the lesson. But if Mom and Dad and going to do all the clean up, which is faster than the child doing it and no effect on his part, the entire process of making an accident inconvenient will fail. It requires a consistent but kind approach.