Here's a full solution. The set of possible $n$ is
$n \le 22.$
We first note that $n \le 22$ is ensured by the 5-fold repetition rule. A position can occur once with an en passant right, then 4 more times each with 4, then 3, then 2, then 1 castle right, and then 5 times with 0 castle rights. A draw will necessarily occur before any position reaches a 23rd occurrence.
Now we will verify every $n \le 22$ is achieved by some position. We will avoid positions constrained by the 75 move rule when possible.
First some remarks about the $n=0$ case. Of course, any position where the number of kings is not 2 is impossible, but also these are arguably not chess positions at all. If we demand that a chess position be reachable in game, then trivially $n=0$ is impossible. If we merely demand that a chess position be reachable by some legal sequence of moves, the following arrangement has this property yet cannot be achieved in a game (with either to move), since the previous position is necessarily dead:
Next, we quickly list the easy cases. We have $n=1$ for any position in a checkmate (or a stalemate, or a king in check to a pawn, etc.). The starting position has $n=21,$ and after a few pawn moves, we can reach a position with $n=22$ involving an en passant right. We can get $n=20$ with a position where the last move is uniquely determined, e.g.:
Any value of $n \in [4, 22]$ which is not congruent to 3 mod 4 can be achieved by moving/removing rooks from the positions mentioned in the preceding paragraph.
Other answers have provided solutions for $n=2.$ Here is the one I originally found.
White to move:
White must immediately castle to avoid an irrevocable move occurring in the next couple turns. The mutually pinned bishops make entrance into the position "one-way."
Next we handle the cases $n=7$ and $n=11.$ For $n=11,$ here's a white-to-move position that can occur once with three castling rights, once with two castling rights, 4 times with 1 castling right, and 5 times with 0 castling rights:
Then $n=7$ is achieved by removing a black rook from this position.
The remaining cases are $n=3,15,19,$ for which we will use positions constrained by the 75 move rule, which I suspect is necessary. First, our example for $n=3:$
It takes 26 turns to return to this position, with one white knight having to reach g2 to unpin the other white knight. This sequence of moves can only occur twice before running afoul of the 75 move rule.
For $n=15,$ we make a position which requires 5 turns to cycle, in addition to 2 extra turns each cycle in which a white rook moves back and forth to spend a castling right (the black rook can spend its castling right without lengthening the cycle). This position can occur 4 times with 3 castling rights, 4 times with 2 rights, 4 times with 1 right, and 3 times with 0 rights, requiring $3*5+2+4*5+2+4*5+3*5=74$ turns.
Finally, here's our example for $n=19.$ This one takes 7 turns to cycle if the white king does not move, but there's a 2 turn cycle with movement of the white king. This position can occur 4 times with 4 castling rights, 3 times with 3 castling rights, 4 times with 2 rights, 4 times with 1 right, and 4 times with 0 rights (it can't appear a 5th time with 0 rights, due to the previous position being determined). Including 2*3 turns spent on using castling rights (the kingside white rook never needs to move, since the white king moving spends that castling right), this takes $3*7 + 2*3 + 3*7+ 4*2 + 4*2 + 4*2 = 72$ turns. It would be impossible to achieve this position with 3 or more castling rights any more times, for that would require 79 turns.