Recently I had an encounter at a bath house. Where we touched each other penis and later I masturbated mine and he tried to put finger near anus and rubbed it. Didn't insert it deep. Am I at risk?
No, this would not be a risk for HIV transmission. HIV is only transmitted through unprotected vaginal or anal intercourse (with penetration) and sharing IV drug needles. Air inactivates the virus. You won't get HIV from anything you describe here.