salam, today one of my friend’s dad expired this morning. so I went to him and met him. he was with the dad body hand his hand was on the head of the dead body. so gusl e masse mayyith is mandatory for him. but here my question is, I have hugged my friend and his shoulder was wet and also his hand. so do I also need to perform gusl e masse mayyith?

It is not wajib on you. It was wajib on the one who touches the body of dead body
Syed Abul Qasim Rizvi