The sum of a half adder is only 1 when ONLY ONE of the two inputs are 1.
If they are both 0, the sum is 0. If they are both 1, the sum is 0 and the carry is 1.
This is the XOR logic gate; either one of the two inputs, but not both. In boolean algebra, XOR can be represented as: ¬AB + A¬B