The king or queen's eldest son takes over when their parent dies. On his death the crown passes to his eldest son.
The job of monarch is passed to sons. You only pass it to your daughter if you don't have a son.
Princess Anne is the Queen's second oldest child but she is only number nine in line to the throne.