It's really not easy to just 'buy a home in Spain' any more.
I live here with a Spanish DH and DD and I know.
You will need Spanish wills firstly, the forms you have to fill in are non ending, the inheritance tax is incredibly complicated, you will need a certain amount in a bank here and to get an NIE number, you will need private health insurance, no WAY you will get it free if not Spanish, this country is not cheap as people seem to think it is.
You WILL be robbed, sorry but you will if you are not here permanently. You will have a nightmare of repairs and land taxes etc, it will cost 1,000's a year.
You will get shafted by 'property management companies'
Who even knows about Brexit?
I am fine luckily as I live here with Spanish family. You will find it a dreadful headache and a money pit. Everything will be a pain in the arse to sort out. Impossible from afar.
I presume your DH is completely fluent in Spanish? If not it is a ridiculous concept. Spain is not letting people come here willy nilly any more. Not at all.
I speak fluent Spanish, but no way I could live here without a Spanish child and a Spanish DH.