This is a tricky question. The native ear will immediately recognize that "had been remained" is not correct. The had should be followed by a past participle. Remained and been are both past participles; you can use one or the other, but not both.
So, either of these could be used to start the sentence:
- He had been president for 20 years...
- He had remained president for 20 years...
This issue gets tricky, however, when you switch to the passive voice. In that case, you can use he had been followed by a past participle, as in:
- He had been elected 20 years ago...
That's a valid formation, and it's listed as the past perfect passive verb form in this table1:
So, the question becomes, why can the verb elected be used in this way, but not the verb remained?
The key is that the sentence with elected is using the passive construction, but the sentence with remained has an active construction. As Dave Sperling says on his ESL website:
Because subjects of passive verbs receive the action, verbs that cannot have objects (intransitive verbs) do not have passive forms.
If you look up the words in a dictionary, you'll see that elect is transitive, and remain is intransitive, which is why had been remained sounds so awkward to the native ear, while had been elected sounds just fine – although many native speakers might have a hard time explaining why.
Now, you can explain it for them: "It's because remained is an intransitive verb, so it cannot be used in the passive voice."
Both sets of sentences are correct, the difference between them is the meaning.
Now this difference is a little hard to explain, but I will do my best.
The verb 'to have' conjugates in the present as 'have' or 'has':
- I, you, we, they, you all = Have
- he, she, it = Has
In the past, it conjugates as 'had' for everyone.
Now when it comes to questions starting with 'to have', asking if someone has done something, they are asking about one of two situations, each with it's own meaning.
When you use 'had' (past tense), then you are asking about any time up to a specific moment in the past.
Had you run a marathon?
Meaning "At any time up until that moment in the past, did you run a marathon?", or "Did you run a marathon by then?"
When you use 'have' or 'have', you're asking about any moment up until right now.
Have you run a marathon?
Meaning "At any time up until now, did you run a marathon?", or "Did you run a marathon by now?"
The difference between the two is the limit of the time asked about. When you ask using the past tense of 'to have', then the limit is referring to a specific moment in the past. When you ask using the present tense of 'to have', then the limit is this very moment, now.
- Have, has = "up until now"
- Had = "up until then"
I hope that helps!
Best Answer
If the action has not finished, the correct choice is has been using. The first sentence is okay.
You can make that first sentence more idiomatic by using ‘for’ instead of ‘since’: “My friend has been using the software for five years”, or “My friend has been using the software for the last five years.”