had been + present participle (verb + ing)
• You had been waiting there for more than two hours when she finally arrived.
• Had you been waiting there for more than two hours when she finally arrived?
• You had not been waiting there for more than two hours when she finally arrived.
USE 1 Duration Before Something in the Past
We use the Past Perfect Continuous to show that something started in the past and continued up until another time in the past. “For five minutes” and “for two weeks” are both durations which can be used with the Past Perfect Continuous. Notice that this is related to the Present Perfect Continuous; however, the duration does not continue until now, it stops before something else in the past.
• They had been talking for over an hour before Tony arrived.
• She had been working at that company for three years when it went out of business.
• How long had you been waiting to get on the bus?
• Mike wanted to sit down because he had been standing all day at work.
• James had been teaching at the university for more than a year before he left for Asia.
• A: How long had you been studying Turkish before you moved to Ankara?
B: I had not been studying Turkish very long.
USE 2 Cause of Something in the Past
Using the Past Perfect Continuous before another action in the past is a good way to show cause and effect.
• Jason was tired because he had been jogging.
• Sam gained weight because he had been overeating.
• Betty failed the final test because she had not been attending class.
Past Continuous vs. Past Perfect Continuous
If you do not include a duration such as “for five minutes,” “for two weeks” or “since Friday,” many English speakers choose to use the Past Continuous rather than the Past Perfect Continuous. Be careful because this can change the meaning of the sentence. Past Continuous emphasizes interrupted actions, whereas Past Perfect Continuous emphasizes a duration of time before something in the past. Study the examples below to understand the difference.
• He was tired because he was exercising so hard.
THIS SENTENCE EMPHASIZES THAT HE WAS TIRED BECAUSE HE WAS EXERCISING AT THAT EXACT MOMENT.
• He was tired because he had been exercising so hard.
THIS SENTENCE EMPHASIZES THAT HE WAS TIRED BECAUSE HE HAD BEEN EXERCISING OVER A PERIOD OF TIME. IT IS POSSIBLE THAT HE WAS STILL EXERCISING AT THAT MOMENT OR THAT HE HAD JUST FINISHED.
REMEMBER Non-Continuous Verbs / Mixed Verbs
It is important to remember that Non-Continuous Verbs cannot be used in any continuous tenses. Also, certain non-continuous meanings for Mixed Verbs cannot be used in continuous tenses. Instead of using Past Perfect Continuous with these verbs, you must use Past Perfect.
• The motorcycle had been belonging to George for years before Tina bought it. Not Correct
• The motorcycle had belonged to George for years before Tina bought it. Correct