You will need to invest a certain amount of money to gain a Golden Visa
The Golden Visa for Spain is a residence visa issued to a non-EU national who intends to make a significant investment in the Spanish economy. The visa offers the holder and their family members residency in Spain and visa-free access to the Schengen Area.
British people who purchase Spanish real estate, or have done so since September 28th 2013, are eligible for Golden Visa status if their investment meets certain conditions and they qualify upon other factors such as criminal record and background checks.
The investment in property required to qualify is more than €500,000.