The past perfect continuous (also known as the past perfect progressive) is a verb tense that shows that an action that started in the past continued up until another time in the past.
How to form the past perfect continuous
The formula for the past perfect continuous tense is had been + [present participle (root form of verb + -ing)].
Unlike the present perfect continuous, which indicates an action that began in the past and has continued up to the present, the past perfect continuous indicates something that began in the past, continued in the past, and also ended at a defined point in the past.
When, for, since, and before are words that you may see used alongside the past perfect continuous tense.