Anyway, on to your question. The phrase in BrE, would be "I pooed my pants" (note that "to" is not required). There are a few variations on the phrase but I'd rather not go into them.
I would like to note that this is not a nice phrase and I would avoid using it, if I were you.
Student or Learner