Ask what is the difference between "have been" and "had been" and you might see this:
Present Perfect Progressive vs. Past Perfect Progressive Tense
Do these terms make your head want to explode?
Let's try to simplify!
They're both verb phrases
Verb phrases are groups of words that include a main verb and a helper (or "auxiliary") verb to describe an action or state.
Have been (helper) + main verb
Had been (helper) + main verb
Used together with a main verb (like "teaching"), have/have been let the listener/reader know when the action took place.
Like past tense, "taught", tells us that the action happened in the past and is finished, "have/had been" tells us something about the relationship between the action and time.
It's all about the timeline
Verbs need to describe when something happened: in the past, present, or future.
You might be familiar with the 3 simple tenses in English: past, present, and future.
I had a sandwich for lunch 2 hours ago. (past simple tense)
I have a sandwich for lunch every day. (present simple tense)
I will have a sandwich for lunch tomorrow. (future simple tense)
But what if you want to talk about something that bridges the past and the present or between two events in the past?
Have been: between then and now
"Have been" describes the relationship between something that happened in the past and now.
"I have been teaching English for more than 27 years."
The reader/listener now knows the following:
I am a teacher now. (present)
I started teaching before 1996. (event in the past)
The use of "have been" connects the past to the current situation.
Had been: between then and then
"Had been" connects two events in the past that are now both finished.
"I had been teaching for 27 years when I retired in 2021."
Now the listener/reader knows two things:
I stopped teaching in 2021.
I taught for 27 years by the time I retired in 2021.
Both things happened and finished in the past.
Take another example describing things that happened in the past:
"I had been teaching in room 222 when the fire started."
The fire seems to have disrupted the teaching but both events described are in the past.
Fill in the blanks: I ________ __________ going to this gym since last January.