I was wondering if this haram and counts as masterbation, I’m not touching my self with my hands or watching that site but sometimes when I’m hard my penis pushes against my underwear causing me pleasure related to this I would make my penis press itself against my underwear adding more pleasure. Is that haram? Also if my body is sore and I’m laying down my penis gets hard from the feeling of my body being sore like if my legs are sore and they’re on top of each other the feeling of the soreness on my body causes me to get hard. And I would put my legs on top of each other while they’re sore because I’ll know it will cause me pleasure I’m worried this counts as masterbation

Anything that you do that will make you ejaculate without your wife doing stimulating you is masturbation.
So go get married, or do muta or practice abstinence and fast.