IsInGroup does not accept units. It is only to check if you are in a group. The only argument it has is to check realm groups or instance groups.
https://wow.gamepedia.com/API_IsInGroup
If it doesn't matter what kind of group you are in, just IsInGroup() is fine.