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.
As a Spanish resident, you will need to submit a Spanish tax return and pay Spanish income tax, at progressive scale rates, on your worldwide income if: