So the first bit can be 1 or 0: 2 possibilities
The last bit has to be the opposite of the first bit: 1 possibility
The remaining n-2 bits can be anything: $2^{n-2}$ possibilities
Thus, the number of bitstrings is $2 \cdot 1 \cdot 2^{n-2} = 2^{n-1}$