This is my understanding of what your example sentences mean:
- I haven't been able to find my keys for two years. (which means I don't have them now, or that I have just found them) (Present Perfect)
- I hadn't been able to find my keys for two years. (which means that there was a period of time in the past, prior to some other past event or occurence, during which I was not able to find my keys. It is possible that I still haven't found the keys) (Past Perfect)
Now, could we replace be able with could?
- Sentence 1 is built using the Present Perfect tense, which is formed thus: HAVE + [verb in the past participle form]: "haven't + been".
This scheme is impossible with could because it is a special form of verb: an auxiliary verb. It is a past-tense form of the verb can.
Auxiliary verbs are "defective". The verb can has no participle forms: you can't say "I had canned play tennis but then I broke my leg" or "I am canning to dance!". So we can't take have (or had) and add the past participle of can to it, since there's no such thing.
When you add have after could, it has an effect quite unlike that of the Present Perfect. The construction serves to express disbelief about a past event or action:
You couldn't have done it! (I express disbelief in what you did. )
I couldn't have found my keys! (I express disbelief in that I have found my keys)
Your example 4 is easier to explain: we do not use had after could, so
I couldn't had found my keys.
What could we do with could? Only one thing:
I could not find my keys for two years.
What would be the meaning? In the past, there was a 2-year period during which I wasn't able to find my keys. Do I have the keys now? Who knows! How long ago did this 2-year period end? Who knows! So it's better to use be able to to express more "advanced" meanings.