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."
Best Answer
I'm going to swipe Lambie's example:
There is no real difference in meaning between these sentences. They are just two ways of saying that something was true in the past, but isn't now.
I should add this is normally the case. There is a popular joke by the comedian Mitch Hedberg:
"Used to" strongly implies that you don't do that thing anymore, but it doesn't rule out the possibility that you still do that thing (or even that you ever stopped). This joke is funny because it defies this expectation.
In the same way, "had done" only describes the relationship of two events in time. It doesn't necessarily mean that you stopped for good.
"Had done" doesn't really work in the Hedberg joke, because you'd have to explain what event caused you to stop, and because it does imply that you actually did stop, at least for a time.