You can apply for Spanish nationality after one year of legal residence in Spain if your grandparents were Spaniards.