Trich was on his skin, so contacting yours was enough to spread the parasite. It happens with some STDs that can be transmitted through the contact skin to skin, as syphilis, herpes and papiloma, but in all those case, your skin needs to touch the lesions that those infections cause on skin.
HIV cannot be transmitted through rubbing, as the virus is really weak out of the body. There has to be penetration or sharing needles to inject drugs with.