The rule is slightly more complex.
Every century is not a leap year, except multiples of 400.
So 2000 is a leap year, but 2100, 2200, and 2300 are not leap years.
In 400 years we would get 100 leap years according to your rule, but 3 of them will not be a leap year, leaving only 97 leap years.
This means that in 100 years, there are actually 97/4=24.25 leap years.