El past perfect se utiliza para hablar de acciones o situaciones que se produjeron en el pasado, con anterioridad a otras también pasadas o a un momento concreto del pasado (past simple).
Past Simple + after / until / because + Past Perfect
I went out after I had done my homework.
Me fui después de que había hecho los deberes.
Past Perfect + before / when / by the time / so + Past Simple
I had done my homework before I went out.
Había hecho los deberes antes de que me fuera.
after / until + Past Perfect + Past Simple
Until I had done my homework, I couldn’t go out.
Hasta que había hecho los deberes, no podía irme.
before / when / by the time + Past Simple + Past Perfect
When I went out the snow had already melted.
Cuando me fui la nieve ya se había derretido.
by (12.00, this time last week / Tuesday / that time / the end of the century etc.) + Past Perfect
By midday, the snow had already melted.
Al mediodía, la nieve ya se había derretido.