The Past Perfect Tense is also called the Pluperfect Tense.
This is used whenever we wish to say that some action had been completed before another was commenced.
The Verb expressing the previous action is put into the Past Perfect or Pluperfect Tense. The Verb expressing the subsequent action is put into the Past Simple.
1. He had been ill two days when the doctor was sent for.
2. He had seen many foreign cities before he returned home.
3. The boat was sunk by a storm which had suddenly sprung up.
4. The sheep fled in great haste for a wolf had entered the fold.
The Past Perfect ought never to be used at all except to show the priority of one past event to another.