1. We form the Past Perfect with had and a Past Participle (e.g. finished, gone):
I/you/he/she/it/we/they had gone.
I/you/he/she/it/we/they hadn't gone.
Had I/you/he/she/it/we/they gone?
2. Look at this example:
Jane had gone home when I phoned her at the office (first, Jane went home; later, I phoned her).
3. We use the Past Perfect (e.g. had gone) for something that happened before something else in the past. We use the Past Perfect for the thing that happened first; we use the Past Simple (e.g. phoned) for the thing that happened later.
Here are some more examples:
When I got home, I saw that the letter had arrived (first, the letter arrived; later, I got home and I saw it).
When he had finished his homework, he went to bed (first, he finished his homework; later, he went to bed).
He couldn't pay the bill because he had left his wallet at home (first, he left his wallet at home; later, he couldn't pay the bill).
I was very nervous because I hadn't driven a car on the motorway before (before = before then).
Note also this example with by the time (=when):
By the time he was twenty-five, he had made a million pounds.