Hello,
You can apply for the Spanish Nationality after one year of legal residency in Spain. Therefore, the first step for you is to become a Spanish resident. You can check the various residency options on the Spanish Employment and Social Security Ministry´s Website, Immigration section.
Best Regards,
Bookmarks