Quick answer
había llegado
The imperfect of haber plus a participle: an action already finished before another past moment.
The forms
| Person | haber |
|---|---|
| yo | había |
| tú | habías |
| él / ella / usted | había |
| nosotros | habíamos |
| vosotros | habíais |
| ellos / ustedes | habían |
The participle is the same one you use in the present perfect and never changes form.
A past inside a past
You need a second past reference point. The preterite marks the moment; the pluperfect marks what was already over by then.
Typical company: ya, todavía no, nunca, antes de, cuando.
Do not use it for a plain sequence
If two actions simply follow one another, both stay in the preterite. The pluperfect is only for stepping backwards.
Memory trick
Fix a moment in the past first. Anything that was already finished by that moment goes into había + participle.
Typical mistakes
Cuando llegué, ellos ya se fueron.
Cuando llegué, ellos ya se habían ido.
Their leaving happened before your arrival, so it needs the pluperfect.
Yo habia comido antes.
Yo había comido antes.
Había carries a written accent in every person of this tense.
Había comido y después había salido.
Comí y después salí.
Two actions in order are just preterite. Nothing steps back behind anything here.
Check yourself
Cuando llamaste, ya ___ salido de casa.