https://www.myjewishlearning.com/article/the-eight-genders-in-the-talmud/
Thought nonbinary gender was a modern concept? Think again. The ancient Jewish understanding of gender was far more nuanced than many assume.
The Talmud, a huge and authoritative compendium of Jewish legal traditions, contains in fact no less than eight gender designations including:
Zachar, male.
Nekevah, female.
Androgynos, having both male and female characteristics.
Tumtum, lacking sexual characteristics.
Aylonit hamah, identified female at birth but later naturally developing male characteristics.
Aylonit adam, identified female at birth but later developing male characteristics through human intervention.
Saris hamah, identified male at birth but later naturally developing female characteristics.
Saris adam, identified male at birth and later developing female characteristics through human intervention.
In fact, not only did the rabbis recognize six genders that were neither male nor female, they had a tradition that the first human being was both. Versions of this midrash are found throughout rabbinic literature, including in the Talmud