In other words, if you visit Spain for a short period of time without having a residence permit, whether your country of origin required you to apply for a tourist visa or not, you can stay for a maximum of 90 days before you actually have to leave or obtain a legal residence permit.