The oracle tells the king and queen of thebus that their child will grow up and kill his father an marry his mother. after learning this, the king and queen had no choice but to make the order to kill their baby
the man who was instructed to kill the baby instead gives it to a shepherd who in turn gives the baby to the childless king and queen of corinth
when oedipus was a young man he learned about the prophecy and believed that he was the child that it spoke of. after figuring this out oedipus runs from home in terror and starts his journey to thebus
on the way to thebus, oedipus is almost ran of the road by a man in a carriage. oedipus kills the man and goes on with his journey.
when arriving to thebus, oedipus was welcomed by the people as their saviors. after a while the people thebus decided to replace the recently killed king with oedipus and organized him to marry the widowed queen
After finding out the original oracles prophecy has came true and that the man from all those years on the road was his father and that he married his mother, oedipus gouges his eyes out as punishment for being blinded from the truth and spend the res of his days living as a begger.