Upvote:6
The issue of a new type C visa does not reset the 90/180 rule. Assuming your visa is a type C visa, you should not have been admitted for two months. You were lucky: nobody noticed.
The Schengen area does not yet have a system-wide database recording entries and exits. They are working on one, but at the moment it exists only as legislation. For the time being, the 90/180 rule is enforced by examining passport stamps. This is probably why your overstay was not caught: at the end of the second visit, the officer probably looked for the entry stamp, saw that it was less than 3 months prior, and stamped you out without paying attention to the other stamps in your passport.
After you have been outside the Schengen area for at least 90 days, however, the 90/180 rule is effectively reset, so you should have no problem going back now.