NAND gate that outputs 0 when all inputs are 0
For the general case of this type of problem, read about Boolean algebra and specifically conjunctive normal form (or its dual 'sum-of-products').
That said, this one is simple enough to do by inspection. Here's one implementation:







simulate this circuit &ndash; Schematic created using CircuitLab

From the truth table you gave, we're looking for an output that is 0 only when A=B=C.

XOR1 compares A and B for equality, XOR2 compares B and C for equality; each of their outputs is 0 when their inputs are equal.

So we want Q to be 0 only when X=0 and Y=0.  An OR gate achieves that.