You must already hold residence in Spain to enlist; service does not give it. A Spanish residence card for a residence authorisation counts. A tourist visit does not.