Spanish residency, begins with a having a right to reside in Spain, either unconditionally, or, for as as long as you continue to meet residency criteria.
Since 28th March 2007, the law (Royal Decree 240/07), has required that all EU citizens planning to reside in Spain for more than 3 months should register in person at the Oficina de Extranjeros in their province of residence or at designated Police stations. Upon registering, you are issued a credit card size residency certificate, (certificado de residencia) with your name, address, nationality, NIE number (Número de Identificación Extranjero) and your date of registration as a Spanish resident.
Apart from the legal obligation to register based on your intention to take up residency in Spain, if you spend 183 days or more per year in the country, then you are deemed to have taken up Spanish residency. You therefore don’t ‘become resident’ by obtaining your residency certificate, in most cases you will by definition and law, be deemed resident in Spain due to the amount of the time you spend here.