If you have been living in Spain for six months (183 days) or more of the calendar year (not necessarily consecutively) or you have your main ‘vital’ interests in Spain (for example, your family or business is in Spain), then you are classed as a Spanish resident for tax purposes.