If you wish to stay longer than 90 days you will need to get a visa appropriate for the purposes of your stay in Spain. Thus Brits or other Non-EU citizens wishing to retire to Spain will generally need to apply for a Golden Visa or a Non-Lucrative Visa if they wish to stay long term in Spain.