The past perfect continuous tense is the past of the present perfect continuous tense.
Compare the examples below.
Present perfect continuous tense
- Ann has been typing a letter for about half an hour.
Past perfect continuous tense
- She had been typing a letter for about half an hour when the computer suddenly crashed.
Present perfect continuous tense
- John's clothes are covered in paint. He has been painting the ceiling.
- Yesterday I visited John. When I came, his clothes were covered in paint. He had been painting the ceiling.