The minimum age if travelling from a country without rabies risk (within the EU or countries listed in Annex II of Regulation 577/2013) is 15 weeks. Your pet must be at least 12 weeks old before being vaccinated against rabies, as the vaccine would not be effective before that, and then wait at least 21 days (the period in which immunity is established) before being able to travel.
Some EU countries accept animals under 12 weeks without rabies vaccination, although most EU countries do not. This can be checked at the following link:
http://ec.europa.eu/food/animal/liveanimals/pets/young_animals_en.htm
If coming from a country outside the EU with rabies presence/risk (not listed in Annex II of Regulation 577/2013), the minimum age would be 7 months. The puppy would need, in addition to rabies vaccination, a serological test in an approved laboratory to determine its rabies antibodies. The test must be carried out at least 30 days after the rabies vaccination and the animal will only be allowed to enter after 3 months from the date of the blood sample.
Spain does not grant exceptions, nor does it authorise the entry of unvaccinated dogs, cats and ferrets.