Here is a summary of the truth tables for all the two input gates. The inputs are labelled A and B. The yellow highlights identify the special cases that it is useful to remember. For example the AND rule is that two ones on the inputs give a one on the output. Any other input gives a zero.

AND
NAND
OR
NOR
XOR
NOT

A B   Q
0 0   0
0 1   0
1 0   0
1 1   1

A B   Q
0 0   1
0 1   1
1 0   1
1 1   0
A B   Q
0 0   0
0 1   1
1 0   1
1 1   1
A B   Q
0 0   1
0 1   0
1 0   0
1 1   0
A B   Q
0 0   0
0 1   1
1 0   1
1 1   0
A   Q
0   1
1   0
B\A
0 1
0
0 0
1
0 1
B\A
0 1
0
1 1
1
1 0
B\A
0 1
0
0 1
1
1 1
B\A
0 1
0
1 0
1
0 0
B\A
0 1
0
0 1
1
1 0
A 0 1
  1 0

Two ones
give a one.
Anything
else
gives 0.

Two ones
give a 0.
Anything
else
gives 1.

Two zeros
give a 0.
Anything
else gives 1.

Two zeros
give a 1.
Anything
else
gives 0.

Equal
inputs
give a 0.

Input
is
inverted.