Answer:
As you know, a year has around 365 + 1/4 days.
This means that in two years, we have:
365 + 356 + 1/4 + 1/4 = 730 + 1/2
and so on.
adding this up, when we have 4 years we have a full day extra, this is:
1460 + 1
When we divide 1461 by 4, we have 365 with a surpass of 1.
The rule used to keep the calendar in sync with this extra day is adding an extra day to each fourth year.
So each fourth year, we have an extra day in Februray (the Februray 29th), this is called a bisiest year.
The "math rule" used to know if a year is leap or not is:
if a year is not divisible by 4, then it is a common year
else if the year is not divisible by 100 then it is a leap year,
else if the year is not divisible by 400, then it is a common year
if not, the year is a leap year.
Where "year" represents the number of the year.