A UK resident may buy property in Spain. However, if you stay in Spain for more than 183 days each fiscal year it is a legal requirement that you become a Spanish resident. The fiscal year of Spain runs concurrent with the calendar year.