Fix any grammar errors in the given sentence.
When we met each other 2 years ago, he have to take the exam for university.
When we met each other 2 years ago, he had to take the exam to apply for university.