Hiya this is Rod, living in Barcelona.
The land laws are coupled to the correspondent town hall, so you must ask them for details.
However, the general national rule says you can't build (no one will grant) on a rural land.
You better check the status (rural/urban) at the Catastro (link below), if your land is urban (very strange outside a town) you are restricted to the area and height already registered.
If the land is rural you have two possibilities:
There's an old building at the land you can maybe restore it under the community's restrictions for visuals and use.
If there's no building or remains at the land, you can't build or live in neither a timber or motor house (latest law changes).
I'm in the same case as you, I dream building my own house but it's not legal to do it under these circumstances.
I recently talked to the person who is responsible of this matter at the Perelló town hall and he was clear about it. I also know some people who receive the demolition warrant from Rural Agents to tear down their illegal house.
The only way to do it is creating a group of people and "sell" a restoration plan for old buildings, this was done by some communities in the past so I guess there is a bit of space to fit into.
There are also failures in the system like the poor guys from Fraguas who were sentenced to jail.
https://www.elespanol.com/eldigitalcastillalamancha/region/guadalajara/20210424/repobladores-fraguas-logran-apoyos-siguen-adelante-planes/576193261_0.html
I'm open to any doubt or connect to anyone with same interests or to share info.
Salut.
Catastro:
https://www1.sedecatastro.gob.es/Cartografia/mapa.aspx?buscar=S