The following is taken from http://europa.eu/scadplus/leg/en/lvb/l33152.htm
For stays of less than three months, the only requirement on Union citizens is that they possess a valid identity document or passport. The host Member State may require the persons concerned to register their presence in the country within a reasonable and non-discriminatory period of time.
Right of residence for more than six months
The right of residence for more than six months remains subject to certain conditions. Applicants must:
- either be engaged in economic activity (on an employed or self-employed basis);
- or have sufficient resources and sickness insurance to ensure that they do not become a burden on the social services of the host Member State during their stay. The Member States may not specify a minimum amount which they deem sufficient, but they must take account of personal circumstances;
- or be following vocational training as a student;
- or be a family member of a Union citizen who falls into one of the above categories.
Residence permits are abolished for Union citizens. However, Member States may require them to register with the competent authorities within a period of not less than three months as from the date of arrival. Proof of registration will be issued immediately on presentation of:
- an identity card or valid passport;
- a declaration by the citizen that he meets the aforementioned conditions, or any other evidence to be determined by him or her.
I have highlighted in red the relevant bit, which says that member states may require foreign citizens to register. It is my understanding that Spain does require you to do so, as explained here: http://www.mir.es/SGACAVT/extranje/regimen_comunitario/estancia_residencia.html The relevant bit is this:
RESIDENCIA SUPERIOR A TRES MESES
-
Los ciudadanos de un Estado miembro de la Unión Europea o de otro Estado parte en el Acuerdo sobre el Espacio Económico Europeo tienen derecho a residir en territorio español por un período superior a tres meses. Los interesados estarán obligados a solicitar personalmente ante la Oficina de Extranjeros de la provincia donde pretendan permanecer o fijar su residencia o, en su defecto, ante la Comisaría de Policía correspondiente, su inscripción en el Registro Central de Extranjeros.
I have used different colours to show which bits are mine, and which bits are plagiarised from other websites. I admit it does all leave it a bit ambiguous re: 3 months or 6 months, but the rule for residency for tax purposes at least has always been 183 days, i.e. 6 months. I would say that if you plan on being in Spain more than 6 months, you should register as Resident within 3 months. Hope this helps and isn't too confusing!