How your brain decides your gender

What causes us to feel male, female - or neither?