Under the Spanish Golden Visa, upon successful application and having made a qualifying real estate investment, you’ll be granted a residency permit with a 2-year validity. It is renewable for additional periods of 5 years, provided that the investment is maintained.
During the temporary residency period, you’ll not be required to live in Spain in order to keep your residency permit renewable.
In fact, you'll only be required to spend 1 day per year in Spain in order to keep your temporary residency status active and renewable.