As another commenter mentioned, it is known as the Surinder Singh application - you have to show that you are genuine residents of the other EU country, and then your home country has to treat you as they would any other couple with the right to live in the EU -
https://www.gov.uk/family-permit/surinder-singh