This is an exercise in counting modulo 7. But even if you don’t know what that means, you can solve the puzzle by first assuming that January 13 is a particular day of the week (say, Sunday, as it was for 2019).
Then February 13, March 13, etc. would be Wed, Wed, Sat, Mon, Thu, Sat, Tue, Fri, Sun, Wed, Fri. Since the most one day appears on this list is three times (Wed), we could shift so that there were three Friday the 13ths. Note that all days of the week do appear at least once, so every year has at least one Friday the 13th.
It remains to check leap years to make sure that you can’t get more than 3 Friday the 13th’s, and in fact leap years can only get two (but again, always at least one).
(By the way, it’s a curious artifact of our Gregorian calendar that in a calendar cycle, which is 400 years long, the 13th of the month falls more often on a Friday than on any other day of the week).