The past perfect is used when you speak about an action that happened BEFORE another action.
had + verbED or had + irregular verb
My mom had worked at the bank for seven years before she quit.
Daniel and Joshua had seen their sister before she walked down the aisle.
I had been at home for hours when they visited.