Between the ages of 6 and 12 I had an issue with encopresis I was also born prematurely, had ADHD and wet the bed until I was 14. I was potty trained for wetting myself in the daytime.
I don’t ever remember pooping my pants at school. Soon after I turned 8 years old, my parents took me to the doctor, and he told my mother to put me back into pull-ups, that's my parents started to make me wear (at the time I was very small) huggies training pants throughout the day even to school, and got away with it without any teasing.
6 months later my parents took me to the doctor again, and he told my mother "as long as he's pooping his underwear put back into pull-ups". So when I would get home after school and during the days I wasn't in school, I'd have to wear huggies training pants 4-5t or pampers underjams s-m. I wore pull-ups on and off until I was 9½.
I did not wear pull-ups during the day again until I was 11yrs old. My father warned me that if I keep pooping my underwear he’ll put me back in into pull-ups. I couldn’t, so he went and bought a case of depends disposable adult briefs/diapers with tabs. They stuck up the back of my jeans about 4 inches it was summer vacation at the time so none of my friends even knew about it.
Soon after I was 12 years old I quit pooping my pants.