Когда она пришла домой, он практиковался в течение двух часов.
He had been practising for two hours when she came home.
Ответ: He had been practising for two hours when she came home.