The past perfect continuous isn’t the most common tense, but it’s still useful to know.
Something that started in the past and continued up to another action or event (tells us ‘how long’)
She had been working at that company for a year when she met James. (This tells us how long something had continued before another event in the past. We usually use ‘for’ or ‘since’ in the same way as we do with the present perfect continuous)
Cause of something in the past
The pavement was wet, it had been raining. (It was raining before the time I’m describing in the past. We could see the result of the rain – compare with the present perfect continuous)