The answer on the question if it is compulsory to have the energy efficiency certificate to sell or rent a property is Spain is yes. It was included in the Royal Decree (Real Decreto) 235/2013 that in is Article 2.1 established that not only every new property build requires that energy efficiency certificate but also those properties that are for sale and rent.
However, there is an exception included in Article 2.2 that can be applied those properties that are used less than four months a year. The letter g) of that article says in Spanish (non official translation below):
“2.2.g) Edificios o partes de edificios existentes de viviendas, cuyo uso sea inferior a cuatro meses al año, o bien durante un tiempo limitado al año y con un consumo previsto de energía inferior al 25 por ciento de lo que resultaría de su utilización durante todo el año, siempre que así conste mediante declaración responsable del propietario de la vivienda”.
“Buildings or part of housing buildings which use is less than four months a year or otherwise for limited periods within a year and with an estimated consumption of energy lower than 25 % of the total consumption usage for a year. That circumstance has to be stated in a formal statement by the owner of the property”.
Therefore, if the property is occupied less than four months in a year, the owner can sign a formal statement invoking that 2.2.g article and stating that the property is being used less than four months a year. That way the owner does not need the energy efficiency certificate to sell or rent and can save the cost of it. When renting the property, the same criteria applies that is that the total yearly usage has to be less than four months a year.
I have been using that formal statement (declaracion responsable in Spanish) for more than six years now to sell properties in the area of Marbella and Benahavis when a property fulfills the requirements and have never had problems when closing at Notary where the Notary will ask for the energy efficiency certificate or equivalent document to comply with the above mentioned Decree 235/2013. It is true that I have been asked more than once how can be proved that the property is used less than four months in a year and the question has been asked a couple of times by Notaries stating that the only requirement of the law is the statement signed by the owner. If that statement is false, the only liability would be on the owner.
* Since every case is different, if you have to sign a for sale deed where the energy efficiency certificate is compulsory, please check the different options and/or documents with your lawyer or notary prior to the signature.