It is defined by ones own identification as male, female, or intersex; gender may also be based on legal status, social interactions, public persona, personal experiences, and psychologic setting.
How is someones gender determined?
A persons sex is typically based on certain biological factors, such as their reproductive organs, genes, and hormones. Like gender, sex is not binary. A person may have the genes that people may associate with being male or female, but their reproductive organs, genitals, or both may look different.