The year must be legal residence in Spain on a residence permit, continuous and immediately before you apply. A student stay does not count.