He would have to put his penis inside of your vagina for you to become pregnant.
Don't worry.
It is zero chance that pregnancy would happen in this case. Sperm does not live long on clothes, and it loses its power almost entirely. With the situation you describe, I wouldn't be worried at all. Not one bit. His penis must contact your vagina directly in order for pregnancy to happen.
I was afraid about a similar situation, not once, not twice, not three times, but many times.
In the end, all my fears appeared to be completely insane and nothing happened. And you know why? because it is physically impossible.
I have MUCH more chance of winning the national lottery and getting a noble prize at the same day than something like that to happen.
If you want to be 100% sure without a doubt (I know how this worrying feeling feels... it is hard), wait just a bit and take a pregnancy test.
But again, take it from someone that worried about this dozens of times... it just can't happen.
But!!!!
Please, always have protection on. l. Because although pregnancy can not happen in this case, STD's can still happen. Unlikely, but can still.
Please use protection.
Have alook on some websites about reproductive cycles. Then next time you won't be so worried and you could always talk to your doctor about birth control as an extra.