In the US and Canada, if a host is sharing the home, they may specify guests by sex. This means that if a male host wants to accommodate only males, they can. Same with females.
This should be clear in the title, description and rules.
If a host has a partner of the opposite sex, and occasional opposite sex visitors, this should also be included.
If the posting is on IB, and a male guest books, this would be in violation of the rules and they can be cancelled without penalty.
Sometimes there are occasional situations where there are multiple rooms and a previous opposite sex frequent flyer or an emergency pops up. I would be inclined to take a consensus of existing guests.