I would use an H-bridge motor driver to reverse polarity, but you only have 1 input. How does the MCU know which polarity to output? https://www.pololu.com/product/2997
This is so nice, answer in short time, thanks for help.
My next question is to help a newbie to make the wire layout (like my sketch) .
Witch pins:
From ESP8266 goes to the "two SPDT's"
and
Which pins goes to my solenoid.
Maybe there must be some resistors in the circuit also..
Don't forget, with 2 SPDTs, you will need 4 kickback suppression diodes to protect the relay contacts and minimize EMI. They are included on a motor driver.
Only comment on that diagram is that it is recommended that the Normally Closed relay contacts be those connecting to the negative or "ground" of the supply.