It's called the distributive laws and the associative laws.
For numbers, addition and multiplication satisfy the following properties:
Associativity. For all $x,y,z$, $(x+y)+z = x+(y+z)$ and $(xy)z = x(yz)$.
Distributivity of $\times$ over $+$. For all $x,y,z$, $x(y+z) = (xy)+(xz)$ and $(y+z)x = (yx)+(zx)$.
These are properties that these operations satisfy. Not every operation does. for example, subtraction of numbers is not associative, and $+$ does not distribute over $\times$. Your first equation follows from the properties above: $\begin{align*} (a+b)(c+d) &= (a(c+d)) + (b(c+d)) &&\text{(distributivity)}\\ &= \Bigl( (ac)+(ad)\Bigr) + \Bigl((bc) + (bd)\Bigr) &&\text{(distributivity twice)}\\ &= (ac)+(ad) + (bc)+ (bd) &&\text{(associativity allows the drop of parentheses)}\\ &= ac+ad+bc+bd &&\text{(precedence of operations: $\times$ goes before $+$)} \end{align*}$
With logical connectives $\land$ (and) and $\lor$ (or), you have two distributive laws: $\land$ distributes over $\lor$: $P\land(Q\lor S) = (P\land Q)\lor (P\land S)$ and $\lor$ distributes over $\land$: $P\lor(Q\land S) = (P\lor Q)\land (P\lor S).$
So we have: $\begin{align*} (A\land B)\lor (C\land D) &= (A\lor(C\land D)) \land (B\lor(C\land D))\\ &= (A\lor C)\land(A\lor D)\land (B\lor C)\land (B\lor D) \end{align*}$