Freud'spsychosexual developmental theory outlines five stages, with gender development taking place in the phallic stage, typically between ages 3 and 6. Prior to this stage, children lack gender identity. In the phallic stage, boys experience the Oedipus complex, desiring their mother but fearing castration by their father. To resolve this conflict, they identify with their father. Girls, according to Freud, experience penis envy, desiring a penis and resenting their mother for their perceived lack. They later substitute this envy with a desire for children, identifying with their mother.
Central to Freud's theory is the concept of identification and internalisation. Children resolve their complexes by adopting the attitudes and values of their same-gender parent, internalising a second-hand gender identity at the end of the phallic stage.
Freud's evidence for the Oedipus complex included the case of Little Hans, a five-year-old boy with a fear of being bitten by a horse. Freud interpreted Hans's fear as castration anxiety displaced onto horses through the unconscious defence mechanism of displacement.