The regulations says either the country stated by passport or residency. The challenge in a case you describe is living long term in a foreign country but most likely do not possess legal status of residency in that country. If that applies to you you'll need to find a way to proof with papers that your life is centered around the country your residing in, even you don't have legal residency. With a documented local work permit and the visa matching that, it should be feasible. Translation provided. If you lack those, you need to find other ways to proof it. Embassy might help (not likely), bank accounts, rental contracts, electric bills etc can help. Being prepared and bring a stack of papers can help to convince an immigration officer, just be prepared if you encounter is first denial and go on and try again.