Past Perfect Tense
The past perfect tense is used to show that one action in a sentence finishes before a second action begins. Words like before and after are indicators that the past perfect tense may be used; however, there are no strict rules for this situation. You must choose the best verb tense for your sentence.
The past perfect is created by using I had, you had, he/she had, we had, you had or they had + past participle.
Both of these sentences are correct.
After he tied his shoes, he left the house.
After he had tied his shoes, he left the house.
The maitre d’ poured the dessert wine, but not until the cake had been cut.
The baby ripped the book before the mother had noticed him playing with it.