THE PAST PERFECT TENSE

The past perfect tense denotes a time before a reference point in the past.
 
He had already eaten before I came.
(i.e. my arrival = reference point)
(had eaten = action preceding reference point)

Formation of the German Past Perfect

Verbs which take the auxiliary haben use appropriate forms of hatten for the past perfect.
 
Ich hatte schon gegessen, ehe er essen konnte.
I had already eaten before he was able to.

Verbs which take the auxiliary sein use appropriate forms of waren for the past perfect.
 
Ich war schon angekommen, ehe er anrufen konnte.
I had already arrived before he was able to call.