You are the one confused, sex and gender are not the same thing. Sex is where your phenotype falls on the sex spectrum, whether on the side we’ve called ‘male’ or on the side we’ve called ‘female’. This only matters when procreating.
Gender is the set of expectations and requirements a society has placed on individuals, of which the society has sorted using sex as one of the criteria. Another criteria, sometimes more important, is an individual’s age (real or apparent). Children are not treated the same as adults, nor is as much expected of them. The elderly also have different expectations and allowed behavior. Each society constructs different concepts of gender, blissfully ignoring all other society’s concepts until they come into direct conflict, after which the individual has to change to match the chosen society or face the full wrath of those enforce the society’s rules (which is just about everyone, mostly those who fear they don’t quite measure up and find solace in punishing those who are obviously misfit).
No society, even those existing within countries in the current interconnected world, defines gender in exactly the same way as others, but we all pretend they do because otherwise those gender roles would be shown to be as superficial as they actually are.
PS, I’m female but I’m growing a mustache and haven’t shaved my legs for years. Don’t need to, they’re hairless.