We assume your [n] means the set {1, 2, 3, ..., n}.
For a subset with n elements, there are 2^n subsets. If we remove 1 and 2 from consideration, then your set [n] contains n-2 elements, hence has 2^(n-2) subsets.
There are two ways to have exactly one of the elements 1 or 2: add {1} to the subsets just described, or add {2} to the subsets just described. Thus, ...
... the number of subsets of [n] that contain exactly one of 1 or 2 will be 2^(n-1).
_____
Example: n=3
There will be 2^(3-1) = 4 subsets containing one of 1 or 2:
... {1}, {2}, {1, 3}, {2, 3}