If you come to Spain intending to stay 3 months permanently, or you stay for 3 month permanently, then you will need to register on the EU Citizen’s Register. As long as you do not stay 183 or more in a year you will not have an income tax obligation.
I very much doubt that in Spanish law there will be a legal qualification as to what sort of break one needs, in order to make a 6 months stay into two 3 month stays. That is, if a day In Gibraltar, France, Portugal etc. breaks the period, or if just a day of two are ignored when making the calculation. I pretty much guarantee that a lawyer would be unable to reliably say either,
Addition
Thanks for that, what if did my 6 months, came back for a month, then did another 6 months is that a problem ?
If you intended doing that from the start, you would be tax resident immediately. If you just 'decided later' then after 183 days in total, you would then become tax resident and liable for tax on worldwide income, and even the income from letting in UK (although taxable in UK, the rental income must be declared for any top-up tax which you might be due).
This message was last edited by johnzx on 26/09/2016.