Suppose I have
p = year divisible by 4
q = year divisible by 100
r = year divisible by 400
and by constructing the truth table I get
p | q | r | is_leap_year
---+---+---+--------------
0 | * | * | 0
1 | 0 | 0 | 1
1 | 0 | 1 | 0
1 | 1 | 0 | 0
1 | 1 | 1 | 1
yield the following boolean expression
$$ \begin{align} & (\, p \land \neg q \land \neg r )\, \lor (\, p \land q \land r )\, \\ & \equiv p \land (\, (\, \neg q \land \neg r )\, \lor (\, q \land r )\, )\, & \text{(distributive law)} \\ & \equiv p \land (\, (\, (\, \neg q \land \neg r )\, \lor q )\, \land (\, (\, \neg q \land \neg r )\, \lor r )\, )\, & \text{(distributive law)} \\ & \equiv p \land (\, (\, q \lor (\, \neg q \land \neg r )\, )\, \land (\, r \lor (\, \neg q \land \neg r )\, )\, )\, & \text{(commutative law)} \\ & \equiv p \land (\, (\, (\, q \lor \neg q )\, \land (\, q \lor \neg r )\, )\, \land (\, (\, r \lor \neg q )\, \land (\, r \lor \neg r )\, )\, )\, & \text{(distributive law)} \\ & \equiv p \land (\, (\, \top \land (\, q \lor \neg r )\, )\, \land (\, (\, r \lor \neg q )\, \land \top )\, )\, & \text{(complemence law)} \\ & \equiv p \land (\, (\, q \lor \neg r )\, \land (\, r \lor \neg q )\, )\, & \text{(identity law)} \end{align} $$
it should be able to further simplified to simply
$$ r \lor \neg q \land p $$
however I couldn't proceed further from what I have now, am I missing something in between?