Sex is assigned according to seven different biological characteristics, which can and do vary considerably. Intersex children are assigned a sex depending on how closely these seven characteristics match male or female. A lot of people have six out of seven matching a particular sex, or five out of seven. A lot of people never find out that they have less than seven matching characteristics. However, this massively calls into question that there is such a thing as two distinct biological sexes.
Furthermore, why do we attach so much importance to sex (clearly a social construct) that we are prepared, as a society, to surgically modify babies?
Gender is how you feel on the inside. You can be non-binary, genderqueer, male, female, femme, butch, gender-fluid, etc.