It helps to remember that the 180-day period keeps "rolling" — as such, for every entry that you make into a Schengen country, you need to count backward the last 180 days and see if you have been present in the Schengen area for more than 90 days throughout that time. For more info on this (as well as access a more streamlined day calculator), see here.