There's a rule called ex falso sequitur quodlibet, "from a falsehood follows anything you want", or "false implies anything". In other words, both "false implies true" and "false implies false" are true.
This is important for mathematical proofs. Suppose for a moment that the opposite were true: that "false implies true" and "false implies false" were false.
In this hypothetical scenario, consider the statement "for any integer x, if x is less than 5, then x is less than 10". Or in other words:
$$\forall x \in \mathbb{Z} : (x<5) \implies (x<10)$$
This statement seems intuitively to be true. But for it to be true, it would need to be true for all integers. Which means it has to be true for, say, the number 7.
$(7<5)$ is false, but $(7<10)$ is true. So $(7<5) \implies (7<10)$ is equivalent to "false implies true". And in this hypothetical, that expression evaluates to false!
It also has to be true for the number 12. Here, $(12<5)$ is false, and $(12<10)$ is false. So $(12<5) \implies (12<10)$ is "false implies false". And in this hypothetical, that expression is also false.
So for statements like "if x is less than 5 then x is less than 10" to be true, both "false implies true" and "false implies false" have to be true.