Answer: The first one. könnte
Explanation: The sentence says: When I lived in Hamburg "I could" speak German.
And since this is past tense it is könnte.
konnte is wrong because it doesn't have "ö"
konnten and können is wrong because they are present tense and not past tense.
Hope this helps:)