The Past Perfect is formed by means of the auxiliary verb to have in the Past Indefinite and the Past Participle (Participle II) of the main verb.
The Past Perfect is used to express an action which took place before another past action or before a definite moment in the past indicated by such expressions as by five o'clock, by that time, etc.
The Past Perfect is used to express an action which began before a definite moment in the past and continued up to that moment with verbs that do not use in continuous.
In adverbial clauses of time and condition the Past Perfect is used to express an action completed before another action which was future with regard to the past.