Once you leave, you cannot return to Spain (or Schengen) without a visa until a further 90 days have gone by. For example, if you have spent 90 days in total in Spain and leave on June 29th, you cannot go back without a visa until at least September 28th.