You're right that 'have you lived' is correct. You could also say 'have you been living', which has the same meaning. In both cases, the person is still living in London now.
You could also say 'did you live', in the past simple. It doesn't mean the person is dead, however. We don't normally ask dead people questions! If you ask someone 'How long did you live in London', it means that the person no longer lives there. For example, 'How long did you live in London?' 'I lived there for three years, from 2005 to 2008'.
It's grammatically correct to say 'How long did you use to live in London?', but we wouldn't use the 'used to' form in this question. We use 'used to' to make a contrast between the situation now and a situation in the past, not to ask how long a period in the past lasted. If someone used to live in London and they now live somewhere else, you would ask them this question in the past simple, as above.
I hope that helps.