The past perfect tense (Plusquamperfekt) is used primarily to differentiate a sequence of activities in the past — in other words, to mark which event occurred before the other one in the past. An example of this in English would be:
Paul had bought a ticket before he went to the concert.
In this example, had bought (past perfect) marks the buying of the ticket as taking place before he went to the concert. The past perfect always indicates a prior event to anything in the simple past or present perfect tenses. There are also some subordinating conjunctions that give clues as to what happened first: nachdem, bevor, and vorher (after, before,
Nachdem er den Fernseher gekauft hatte, schaute Markus oft zu Hause Fußball an.
After he had bought a television, Markus often watched soccer at home.
One caveat to keep in mind, however, is that the past tense passive voice, which uses the simple past form of the verb werden (i.e. wurden) with a past participle of the main verb at the end of the sentence in regular word order, might follow the event or action that occurred earlier in the past. It looks like it is the past perfect, but it is actually different For example:
Die Hausaufgaben wurden gemacht. / The homework was done.
In English, the passive voice uses the helping verb “to be,” whereas, in German, the helping verb is a form of werden, is not to be confused with the past perfect. Thus, it is possible to see the passive voice and past perfect in the same sentence, but only the past perfect is understood as having occurred prior to the passive voice sentence.
Bevor die Hausaufgaben gemacht wurden, hatten die Kinder fergesehen.
Before the homework was done, the children watched TV.