We can use deduction to answer this with a few givens: the Leaf was created by Madara so it didn’t exist before him, and extracting a Bijuu kills its host, even Uzumakis (it just takes a little longer).
Okay, so going from that, we know that Madara was the first attack, that makes one. In response to the Madara attack, the first Hokage put the Kyuubi into his wife, Mito Uzumaki. We also know that it was directly given to Kushina Uzumaki from Mito. This means it never left Mito because she would’ve already been dead. While Kushina was in possession of the Kyuubi, it was extracted by Madara again, the second attack. Immediately after, it was given to Naruto, and 12 years later the events of Naruto began.
Thus, we can conclude that the Nine Tails was used to attack the Leaf exactly 2 times.