It is presumed when you spend at least six months and one day during the calendar year in Spain or when the centre of your activity or of your economic interests is based in Spain. It is acquired when you declare you usual residence at the Local Council and you submit you income tax return at the tax Administration. The latter may then issue a tax residence certificate.