Hard to fathom how you are managing that.
Taking screenshots require you press 2 buttons at he same time on opposite sides of the iPhone.
Unless your pants are super tight its hard to manage accidentally.
Do you maybe have the option for shortcuts using the back of the iPhone set to screenshots?
If the "double tap" option is set to Screen shots it may be getting activated there. You can turn that option off
click here ➜ Tap the back of iPhone to perform actions or shortcuts - Apple Support
Otherwise, the regular screen shot method using the volume up and sleep buttons cannot be disabled.