I had studied Japanese before I moved to Tokyo.
He had washed the dishes when Julia came.
She had lost her wallet before she came home.
There are two actions in the examples and the sequence of events is clear: one action is completed and it (had studied, had washed, had lost) happened before the other (moved, came) - it's Past Perfect Tense.
She had left when he arrived.
1. Are we talking about the past? (yes)
2. How many actions are there in the past? (two)
3. Did both actions happen at the same time? (no)
4. Did one action happen before the other?(yes)
5. Which action happened first? (She left)
The structure of Past Perfect Tense is the following:
Affirmative: Subject + had + Ved/3
Interrogative: Had + subject + V ed/3?
Negative: Subject + had + not + V ed/3
We often use contractions (especially when speaking) in Past Perfect by contracting the subject of the sentence:
1. I had > I’d – After I’d used the phone, I had lunch.
2. He had > He’d / She had > She’d / It had > It’d – It’d happened so quickly, I didn’t understand anything.
3. We had > We’d / You had > You’d /They had > They’d – We’d just come home, when we heard that noise.
What about Past Perfect Continuous? Look at the examples:
I had been dreaming about true love for years when I finally met my husband!
She had been doing her homework before he came.
We had been eating that delicious pizza when the waiter brought our bill.
What all these sentences have in common? In examples above we have two actions: one action happened first and it took some time (it is important!!!) - had been dreaming, had been doing, had been eating and then the second action happened (met, came, brought). So, we see that something (waiting, doing, eating) started in the past and continued up until another time/action in the past. It has a "duration" and this "duration" is important in every Continuous tense!
They had been swimming in the water for 2 hours when they were rescued.
1. When did they start swimming? (at 2pm)
2. What time did they stop swimming? (at 4pm)
3. How long were they swimming? (2 hours)
4. Did they stop swimming when they were rescued? (yes)
Past Perfect Continuous Tense
MORE EXAMPLES
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.”
Past Perfect has the same meaning as Past Perfect Continuous when the main verb in the sentence is a stative or non-continuous verb and action in the sentence is in progress. In this case even if the first action (which started in the past) continued up until another action in the past, we cannot use Past Perfect Continuous, only Past Perfect!
I had had that car for 5 years before it broke down. (NOT I had been having).
We felt bad about selling our car because we had owned (NOT had been owing) it for 10 years.
Past Perfect Continuous is also used to express cause of something in the past:
I was tired because I had been working a lot.
Kate gained weight because she had been overeating.
We missed the plane because we had been waiting our taxi for an hour.
What do we have here? There are two actions (again), both are in the past and they're connected with each other (one action is the result of the second one).
The structure of Past Perfect Continuous Tense as you can see above is the following:
Affirmative: Subject + had + been + Ving
Interrogative: Had + subject + been + V ing?
Negative: Subject + had + not + been + V ing
The contraction in this case is also possible and it's the same as we use in Past Perfect.
With both tenses we can use adverbs (just, ever, never, only, always etc.) but in Past Perfect they are usually not necessary:
I had only been waiting there for one minute when the bus arrived.
They had had dinner when the concert started.
Wh-questions in this two tenses are formed in the same way:
Wh-question + main question
What had you done before entering the university?
Why had he been waiting for me outside?
Let's summarize!
Both tenses:
are used in the past;
usually have 2 actions in the sentence or specific markers (when, before etc.)
have similar contraction and adverbs;
BUT:
One of the actions in Past Perfect is usually completed (it gives us the answer - What has happened) and in Past Perfect Continuous is in progress (its answer is How long).
When the action is in progress and the main verb is a stative verb - we use Past Perfect (NOT Continuous)
To explain the CAUSE, one action leading to another, we use Past Perfect Continuous