i know this sounds silly
but i wonder if you could help me with this? my students have answered both and im confused
How long did you live in your last flat?
or How long have you lived in your last flat?
i know that the action has started and finished
some time in the past, thus makes it past simple
don't we generally use Present perfect with how long?
how long have you been there for?!
Note that the present perfect of experience, one of a number of PP uses, can still be used for your example, Iteach. It can do this because it contains within a sense of "up to now", usually noted by 'ever'.
Have you ever lived in a flat?