Original biological categories for sex: female, male, neuter, hermaphrodite. Based on the capacity to produce male or female sex cells for the purpose of reproduction. Problem - post-operative women of transsexual history would be defined as "neuter" under this system. (As would any infertile person.)
Word evolved in definition to categorize humans based on the appearance of their genitals at or just after birth. Intersex replaced hermaphrodite and neuter is dropped (considered offensive). Problem - post-operative women of transsexual history would be defined as "male" under this system.
Word evolved in definition to categorize humans based on their XY or XX chromosomes. Intersex definition expanded to include non-XX or XY chromosomes. Problem - post-operative women of transsexual history would be defined as "male" under this system. (As would CAIS women though often some concessions are made given their entirely female appearance.) Many countries in the world use either this definition or the previous one - i.e. changing your gender marker is not possible.
Word evolved in definition to categorize humans based on their current sex organs. Surgical approximations accepted as well as "natural-born" genitals. Problem - post-operative women of transsexual history would be defined as "male" pre-surgery under this system. Though some find this acceptable. Further problems - people who have had their genitals damaged or destroyed lose their sex status under this system (example: boy soldier steps on a landmine and ceases to be male) - concessions are regularly made in these circumstances undermining the integrity of the system. Intersex children have been historically (and in some places still are) mutilated against their will based on this system. Some countries use this definition including Canada and much of the US.
Word evolved in definition to categorize humans based on the sum of their sex-differentiated parts. Problems - concept complex and currently in flux. Most important sex-differentiated part (brain) is only just starting to be analyzed in medical science. Much of Europe now uses this definition in some form.
Alternative: Word evolved in definition to categorize humans based on their chosen sex identity. Problems - loses any connection to biological categories and concept currently in flux. Possible legal problems and abuses with this system. No countries use this definition to my knowledge.
Language is fun! Also, messy.