Freud's psychosexual 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.