You will kill your father and marry your mother... it is the prophecy
King Laius is warned by a mystical oracle that if he had a son, he would kill him and marry his wife.
as an infant, he crawls on all fours; as an adult, he walks on two legs; and in old age, he uses a walking stick.
“What walks on four feet in the morning, two in the afternoon, and three at night?
Oedipus is sent away to avoid the prophecy from happening, but later is approached by an an oracle giving him the same message as his father.
I am the new king! Will you marry me Jocasta?
Yes I will
In efforts to stop the prophecy, Oedipus leaves for Thebes and on the way he runs into a chariot. Unknowingly to him his birth father is driving the chariot and they get into an argument. Still not knowing Laius is his father, Oedipus kills him.
Oedipus continues on his way and later discovers a Sphinx along the way. The Sphinx requires all travelers to solve a riddle before passing through. If you answer the question wrong you are killed. Oedipus answers the riddle correctly and passes.
You may pass.
It was said that any person who could solve the riddle would become the next king. King Laius was dead and since Oedipus solved the riddle, he became the new king and receive the queen's hand in marriage. By accepting Jocasta's hand in marriage, Oedipus completes the prophecy. They then have 4 children together
Years pass and Oedipus figures out the truth. He fulfilled the prophecy. Jocasta commits suicide and when Oedipus finds her, he is stricken with grief and stabs out his own eyes. He is then exiled to Thebes and take two of his daughters along to guide him.