Past perfect tense refers to an action that leads up to another in the past. The more contemporary past event is expressed in the simple past, and the earlier past event is expressed in the past perfect.
Pattern: Subject + had + Past Participle of Verb
Richard had lived in Europe, before he moved to Australia.
He had visited his sister before he went for the study in the USA.
The merchant had closed his shop.
I had left the house before it rained.
Her father scolded her because she had failed in the examination