OK - I wrote this quite late at night, and originally in reply to another post. the original sentences should read:Thank you, hopefultoo, for such a detailed explanation! I do still find it a bit confusing as the original sentences in your post don't use reported speech. It's a bit unclear when he showed the flat to me - a long time ago, which might mean we have no information where he dwells now - or, say, a couple of hours go, which makes it possible to use present tenses 'has lived' or 'has been living' (am I right?) Since there is no context, we can conclude it's safer to talk about the past, and so we end up with either 'had lived' or 'had been living'.
I'm afraid your explanation is simply incorrect - no other continuous activity is assumed or need be mentioned.Had lived is a simple statement of fact. Meeting is an instantaneous activity, so there is no need for a continuous verb form. We say had been living if somewhere in the context there is another continuous activity mentioned or assumed.
When I met him he had lived in Brighton for 5 years.
When I met him he had been living in Brighton for 5 years and playing second fiddle in the orchestra there,
It's all about the tenses used. It's important to grasp the meaning of the present perfect tense and to understand how it differs from the past tense and the present simple, in particular. Unfortunately, since the ideas behind the present perfect (and its continuous form) are rather subtle they are poorly (and sometimes erroneously) handled in many grammar books. I teach these tenses regularly - it usually takes about 2 weeks with upper intermediate or advanced students to undo the damage done by previous misconceptions and replace these with a reasonable understanding of how they should be used.Thank you! Does anything change if we assume there is no reported speech in the sentences but there is a relative clause introduced by 'where'? I don't think my last sentence sounds strange in the light of this fact.