I havnt read every post so I’m not sure if I am repeating advice or not already given but here goes as I have been In your situation not once but twice with both children. There were days were I thought they’d be pooing their pants till they were 16years old as I saw nooo light at the end of the tunnel but lo and behold we got there in the end and so will you.
Both using toilet for poos by 3years 6/9 months… much much later than I wanted but it is what it is. General principles no shame at all, NO big reactions at all to the pooing in pants. Oh you’ve pooed, let’s go to toilet and tidy up. Poo goes in toilet. Repeat, no negative reactions, no shame, no irritation ( easier said than done I know!) then with first child we used an object of reference, so I figured out when he went to poo he always stood behind this wee coffee table thing, so slow slowly that coffee table over weeks moved closer to the bathroom. That eventually he was going to poo standing in bathroom. While we were doing that process I asked him to tell me when he was doing a poo so I could give him a pull up. Initially didn’t tell me however if I spotted him near the table I said it looks like you need a poo let’s get a pull up on . Poo done, no big reaction or praise just oh I’m sure your tummy feels better for pooing, poo goes in the toilet and we changed and flushed it together. So eventually we were left after a few weeks of pooing in pull up behind a table in the bathroom( ridiculous I know!) then we moved to moving towards toilet, sitting on toilet with pull up on then emptying .then eventually ( maybe6 weeks of this back into pull ups and table malarkey started) he pooed on the toilet with the pull up sitting in the toilet bowl ( again ask me before I had children if I’d ever see myself so invested in poo and the answer would be no!) and then next day no pull up in toilet just toilet roll ( to stop the splashes !) and I thought it was the happiest day of my life. And so it continued… a week short of starting pre school, pooing in toilet!
Second child, similar to a degree ,but was holding on and would hold for days( up to8) big fear of toilet . Started movicol so they pooed everyday. So again same principals no shame , no big reactions and back into pull up for poos, for that child there was no object of reference but I noticed they usually pooed in evening after dinner so every evening after dinner pull up on in case they need a poo nice and causal no drama then same tidy up together, poo belongs in toilet routine, I’m sure your tummy feels better etc. this continued for weeks and weeks but to be honest I was glad we’d moved from pants to pull ups ( narrative was pull ups just for poos) as I had less pants to throw out!! Then one sweet miracle day, we were out later one evening and for the first one ever they said they needed a poo ( never ever said that before) . I had no pull up . So I said no problem mummy doesn’t have pull up but was a public toilet and took them expecting no poos but to my absolute shock they sat on toilet and pooed. And that was it- enough to get them passed the fear. From that day on.. toilet for poos. So We skipped the pull up in bathroom stage and moving closer to toilet etc for that child. But I can’t empathise enough that I was 100% convinced that both children wouldn’t get it, but with time, no pressure ( I think that was the key) they did.
another thing i did during all this was to try to get them to realise when they needed a poo, so initially once they’d pooed themselves in pants and I’d missed it I said oh your tummy was trying to tell you you needed a poo, what did it feel like etc. then if I spotted them going to their spot I’d say oh I think you tummy trying to tell you you need a poo ( no pressure to do poo in toilet) Then when they did poo in pants I’d be like see look that feeling in your tummy was your tummy saying you needed a poo.
Not sure if any of that is in anyway helpful but I just wanted to reassure you that with miraculous levels of patience I’m sure your child will get there too!!!!