monarc,
Good question. Let's dive into the difference between "have been" and "had been"...
"Have been" is used for an action from the past that is still in progress. For example:
"I have been walking since 2:00 p.m., and I'm not tired yet!"
"I have been searching for my dog all month, but we haven't found him!"
Notice how in these examples, there is no past tense verb in the sentence and I am still walking/searching. As a result, I use "have been" (present perfect tense).
On the other hand, "had been" is used for an action that happened before something else in the sentence occurred. For example:
"I had been walking for six hours before I stepped on a rock and sprained my ankle."
"I had been searching for nine hours before I decided to give up."
Notice how in these examples, you do have a past tense verb in the sentence ("stepped" and "decided") that describes something that occurred after the first thing started. Since you have an ongoing action in the way past and another action in the past that comes later in time than the first action, you need to use "had been" (past perfect tense).
Finally, notice that it doesn't matter which part comes first; the past perfect part can follow the past tense part in the sentence even though the order in which they occurred is the reverse. Just remember that if there are two things that happened at different times in the past, you'll need to use past perfect somewhere. For example:
"Before I stepped on a rock and sprained my ankle, I had been walking for six hours."
"I decided to give up after I had been searching for nine hours."
Happy studying!
Brett