this should help..
https://circuitglobe.com/demorgans-theorem.html
The result is due to de Morgan's law, but you can confirm it for yourself using a truth table.