I had been waiting there for more than two hours when you finally arrived.
I had waited there for more than two hours before you finally arrived.
When we came to the station, the train had already left.
I had been writing a letter for 3 hours when my brother came.
past perfect:
I had gone by 5 o'clock
(я пришел к 5 часам)
past perfect continious:
He had been sleeping for 2 o'clock
(он спал в течение 2 часов)
это когда действие произошло но результат важен сейчас. например "я сломал руку вчера" я сломал её вчера но гипс виден сийчас
I remembered we had met before/
I had been renting the flat for five years.
Past Perfect tense
By the time I came home my children had already gone to bed.
He had already translated the text when I phoned him
Past Perfect Progressive
He had been translating the text for an hour when I called him