If A and B are not mutually exclusive n(A) + n(B) counts the outcomes in both A and B twice.
To make sure each outcome is counted only once you must subtract the number of outcomes in
A and B. You then get n(A or B) = n(A) + n(B) ̶ n(A and B), giving
or P(A or B) = P(A) + P(B) ̶ P(A and B)