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
The examples below show the placement for grammar adverbs such as: always, only, never, ever, still, just, etc.
You had only been waiting there for a few minutes when she arrived.
Had you only been waiting there for a few minutes when she arrived?
ACTIVE / PASSIVE
Chef Jones had been preparing the restaurant's fantastic dinners for two years before he moved to Paris. Active
The restaurant's fantastic dinners had been being prepared by Chef Jones for two years before he moved to Paris. Passive
NOTE: Passive forms of the Past Perfect Continuous are not common.