Past Perfect Tense is used to express the past action, already finished when another past action happened.

( In such sentenses, it is not emphasized how long or how many times the action has continued. It is emphasized that the action had happened before another action. However, sometimes we can see the duration of the action in a sentence. In this case also, Past Perfect Tense shows that the action was completed at the given time and it is emphasized that the event started and finished in the past, not the duration of the event. )

Examples:

I had made a decision before you called me.

When she arrived, the bus had already left.

My mother had written three books before she died.

I had never seen him for 5 days. But I saw him yesterday. ( the event was completed – I finally saw it )

When her husband died, they had been married for 30 years. ( the state was completed – They were no longer married )

HOWEVER;

Past Perfect Continuous Tenseis used to express a past action which started in the past and continued to happen after another action or time in the past.

( In such sentences, Past Perfect Continuous Tense tell us “how long the action had continued” or ” the duration of the action” is emphasized more in this tense. Namely, Past Perfect Continuous Tense shows that the action was not completed after that time ( the event continued to happen ) and it is emphasized the duration of the event. )

Examples:

We had been looking for the wallet for 2 hours when Susan found it.

She had been writting reports since morning when the boss came the office.

Tom had been sitting in the garden for 2 hours when his friends went to the cinema.

They had been celebrating their wedding anniversary for hours when David arrived.

My wife had been cooking the meal since 4 o’clock when my father called us.

2.

In reported speech,Past Perfect Tense is used instead of “Simple Past Tense and Present Perfect Tense in direct speech” )

Examples:

He told us he had visited Paris twice before. ( He told ‘ I have visited Paris twice before’ )

Jackson asked the singer when he had sung his first song. ( Jackson asked the singer ‘When did you sing your first song? )