According to the Agreement reached on December 15th, 2017, United Kingdom citizens living in Spain for more than five years on March, 29th 2019 will obtain settled status.
Residents in Spain for less than five years will be able to stay until they have reached the five years threshold from the day of residence obtention.
Citizens with a settled status scheme will keep their residence, healthcare rights, pension and other benefit provisions as they are today.
The above information provided by Lextax. For more information see their blog.