Strictly speaking it is time spent in the Schengen countries, not the EU, and it is 90 days in 180 calculated on a rolling basis. If the OP were to spend 90 days in October, November and December in Spain, they could not re-enter the Schengen area until around 1st April the following year (unless they had a visa or residency permit). Note that the limit is 90 days, not 3 months - staying for the whole of Oct, Nov and Dec would be 92 days and therefore be over the limit.
The 29 Schengen countries are Austria, Bulgaria, Belgium, Czech Republic, Croatia, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Iceland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Netherlands, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden, and Switzerland.
Switzerland, Iceland and Norway are not in the EU but are in Schengen.
Ireland and Cyprus are in the EU but are not in Schengen.