The past perfect tense is used to describe:
1. an action that began and finished before another action in the past.
a. The people had already evacuated before the category five tornado struck the city.
b. When we arrived at his house, he was not there. He had already left.
c. I missed the lesson. When I arrived, the classroom was empty. The professor and all other students had left.
It doesn’t matter whether we use ‘When’ or ‘Before’ in our sentence. The idea is the same. We use the past perfect tense (had + past participle) to describe the action that happened earlier before the other one, and we use the simple past tense to describe the action that came later.
2. an action that began and finished before a specific time in the past.
a. Usually shops are open until 7 PM. Last night, however, they had been closed before 6 PM.
b. They had finished the project before the due date of July, 31.
Remember that we use the past perfect tense (had + past participle) to emphasize that an action happened earlier than another action. If that is not the case, we simply use the simple past tense. Look at the following example:
Soekarno declared Indonesia’s independence on August 17, 1945.
To describe the action, we cannot use the past perfect tense because it did not happen before another action.