The past perfect continuous tense (also known as the past perfect progressive tense) shows that an action that started in the past continued up until another time in the past. The past perfect continuous tense is constructed using had been + the verb’s present participle (root + -ing).
Unlike the present perfect continuous, which indicates an action that began in the past and continued up to the present, the past perfect continuous is a verb tense that indicates something that began in the past, continued in the past, and also ended at a defined point in the past.
He had been drinking milk out the carton when Mom walked into the kitchen.
I had been working at the company for five years when I got the promotion.
When, for, since, and before are words that you may see used alongside the past perfect continuous tense.
Martha had been walking three miles a day before she broke her leg.
The program that was terminated had been working well since 1945.
Cathy had been playing the piano for 35 years when she was finally asked to do a solo with the local orchestra.
He had been throwing rocks at her window for five minutes before she finally came out on the balcony and said, “Hey, Romeo.”