To form past perfect continuous tense questions, we start by the helping verb "Had", followed by the subject, the word "been", the main verb with -ing, then the rest of the sentences.
Notice how the subject and the helping verb "had" switch places from assertive sentences to questions.
1. you / live / in London
2. he / paint / the house / for three days before the rain came
3. we / argue / over the decision / when the director intervened
4. he / search / for his glasses / before he found them under the table
5. we / try / to fix the problem / for hours before the expert arrived