It is the past perfect tense, used when you have one event earlier in time than a second event in the past. I moved to London last year (event in the past) . Before that, I had lived (an earlier event in the past) in Spain for many years.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.