We use the past perfect to show that one past action happened before another past action. We form the past perfect by conjugating the auxiliary verb have to the past simple had.
Let’s look at some examples.
Jack and Amanda had visited Italy every summer before they moved there.

The past perfect tells you which action happened first.
1st action Jack and Amanda visit Italy
2nd action Jack and Amanda move to Italy
You can change the order of the sentence but the past perfect still happens first.

The past perfect is also used in the third conditional to talk about an unreal past action with an imagined result.
Examples:
If I had studied for the exam, I would have passed.
If I hadn’t cut my hair, it would have been longer.
If I had known you were in town, I would have met with you.
The construction of the past perfect
In the affirmative, the past perfect is formed by using
subject + had + past participle. To make a question, we put the auxiliary verb before the subject.

Contractions
Contract the subject and the auxiliary verb in positive sentences.

Click here for Past Perfect quiz.
