"Nunca habíamos vivido en la ciudad."
Translation:We had never lived in the city.
Try not to get caught up in translating word-by-word, left-to-right, etc. It is just going to cause confusion and frustration because all languages aren't required to be ordered/arranged similarly to English. Eventually you will begin to see an entire phrase for what it means instead of having to translate the words in the sentence. In the same way that you can say that is is obvious that the phrase 'never had we lived in the city' is grammatically correct and would be widely understood, a native Spanish speaker could say that is is obvious no one who knows Spanish would arrange the sentence 'Habíamos nunca vivido en la ciudad' because it is nonsensical. So, just because the Spanish word that directly translates to the English word 'never' is the first word in the Spanish sentence, doesn't necessarily mean it needs to be the first word in the translation sentence. You are right in saying the form you entered should be counted correct, but the Spanish sentence didn't need to be translated into English in that manner solely because that was the order of the words. If you must, translate the sentence from left to right and then ask yourself first, if the sentence now makes sense in the language to which it is being translated, and then, maybe, does it now sound like I'm on stage in the 14th Century? You weren't wrong in what you said but your comment brought up a deeper train of thought in my mind that I have noticed a lot lately. A sort of 'how dare this language not follow the rules of the language I speak' kind of mentality. For what its worth, I've found that eliminating the idea that languages are parallel makes it easier to move back and forth and eliminate frustration.
This is very well put, and explains very well why I think the people who answer "never had we lived..." or in a similar manner on other exercises learn more by losing a heart than by calling it right.
Yes, it's a grammatically valid translation, but getting grammatically valid translations isn't the same thing as learning the target language.