I have lived somewhere for X years would normally be used in a context where I'm still living there, but it can also be used in a context where I'm no longer living there: living there for five years is part of my past (not present) experience – zkušenosti, již dosažené skóre. As always, the intended meaning will be clear from the context.
Použití předpřítomného času: (…)
- Zkušenosti, “již dosažené skóre”
První z nich je, když mluvíme o svých zkušenostech, dosažených výsledcích, o tom, co jsme JIŽ udělali nebo JEŠTĚ neudělali. (HFE předpřítomný čas)
„I have been living in London for five years“ tells us that you are still living there and that you have been living there in one continuous time period.
„I have lived in London for five years“ can (but does not have to) mean the same. So, it can mean that you currently live in London and that you have lived there for an uninterrupted period five years.
But it can also mean that you are not currently living in London, but that you have in the past lived there for a total of five years. And these five years do not have to refer to one continuous period of five years. They could refer to multiple past periods that add up to five years.(stackexchange)
I have lived in China for five years – that could be something that happened in the past, and has a present effect – but it feels awkward using it to say something happened in the past. It is much more natural to use it when you mean up to the present.
But there could be contexts where it fits, e.g.
A: I have been to China. I went on holiday there last year, for two weeks. So I am an expert on China.
B: I have spent much more time there than you. I have worked there. I have lived there for five years. That is a long time. And even though that was twenty years ago, that still makes me more of an expert than you. (thefreedictionary)
As part of my zkušenosti, již dosažené skóre, I have lived in the Czech Republic for 12 years, but I'm not living there now.