Two ways to complement a function
De Morgan's theorem. Write F' = (F)' and push the complement inward one law at a time: (X+Y)' = X'·Y' and (X·Y)' = X' + Y', cancelling double complements (X'' = X) as they appear.
Duality + complementing each literal. The complement of F is the dual of F (swap AND and OR, and swap 0 and 1) with every literal complemented: F'(x) = Fd(x'). Complemented groups, XOR and XNOR are first rewritten into plain AND/OR/literal form, because duality only applies to that form.
Both methods always give the same function.