1. He LEFT school 2 years ago
2. I LIVED in Cardiff for 2 years, then I moved to Swansea.
3. Correct
4. My sister HAD her baby yesterday
5. Correct
6. Correct
7. Correct
8. I MET Sandra when I WAS at university
You want to use the present perfect (have + verb) when the word that expresses the time INCLUDES NOW. For example today, this week, this year, since I was 12, for 15 years (including now).
We use the simple past when the time expression does not include now. For example yesterday, last week, when I was 2, 7 years ago etc.
An example of both would be:
"I've eaten an apple today." - this includes now as we are using 'today'.
"I ate an apple yesterday" - this does not include now as we are using 'yesterday'.
I hope this explanation makes it clearer for you! :)