Freud believed that the Oedipus complex occurred during the phallic stage of psychosexual development, which occurs between the ages of 3 and 6. During this stage, a child takes pleasure in his or her own genitals. At the same time, children also begin to identify with their parents of the same gender. This leads to a desire for the parent of the opposite sex and jealousy towards the parent of the same gender.
The Oedipus complex is ultimately resolved when a child enters the latency period. During this period, a child's sexual desires are repressed and they focus more on social and intellectual development.
Freud believed that the Oedipus complex was an important part of healthy psychological development. He argued that children who did not resolve the complex successfully would develop psychological problems later in life.