You can apply the same criteria if for shaking hand if the person is much older and it’s some how necessary but if one can avoid its better as for as hugging concern it’s not allowed if he/he is non mahram.
For more detail please follow the link below:
https://www.al-islam.org/code-ethics-muslim-men-and-women-sayyid-masud-masumi/rules-related-socializing#rules-touching