A minority of modern western people don't identify with the male/female dichotomy and embrace an intermediate space, or third gender. Beyond the west and through prior ages of history, how common were such orientations? How did societies deal with nonbinary genders?

by RusticBohemian
SavageSauron

As an introductory read, u/sunagainstgold answered on the topic of sex / gender in the Middleages here and here.