1: Something that started in the past and continued up to another action or time in the past. The past perfect continuous tells us 'how long', just like the present perfect continuous, but this time the action continues up to a point in the past rather than the present. Usually we use 'for + time'. (We can also use the past perfect simple here, often with stative verbs.)
2: Something that finished just before another event in the past. This is usually used to show a result at a time in the past. It's very similar to the present perfect continuous, but the action finishes before another time in the past, rather than finishing before the present.
{}