When I .. (leave) for school this morning, my friend called me.
Нужно изменить слово в скобках в соответствии с временем предложения.
When I was leaving for school this morning, my friend called me.