After spending a summer trying to sort out my gap year plans, I have finally come across an opportunity last minute and they want me to start asap. It is unpaid volunteer work, but I would like to be in Spain for more than just three months. My thinking was I could sign up for classes at a university and get a student visa, but I obviously won't have time to do that now.
I was thinking I could just go to Spain some time in the next few weeks with no visa, since it is my understanding that I can spend 90 out of 180 days in the Schengen area without applying for a visa. My question is, could I apply for a student visa once I am already in Spain? Alternatively, could I prepare all of my documents needed for a student visa, return to the US once my 90 days are up, and apply for the visa at home, and then go back to Spain once it is approved, or would I be ineligible to get a new visa and go back to Spain if my 90 days of being in the country as a tourist have already expired? In other words, could I avoid the three month waiting period of being outside the Schengen area after my 90 days have expired by simply getting a new type of visa issued, or can I not get a new visa during this period?
Thanks so much for the advice.

