Upvote:4
Apply to the country that is the main destination of your first trip.
If you write that you are planning another trip to Schengen, they might be nice and issue you a multiple entry visa, and then you have a visa for your second trip, they might also be less nice and only issue a single entry visa (depending on a lot of factors, your - as I write this, undisclosed - nationality being one, you often need a good travel history to get a multiple entry visa), in which case you'll also have to apply to Spain for a visa for the second trip.
Of course there's also the possibility that your application will be refused.