We interpret "to the right" as meaning immediately to the right.
Let $b_n$ be the number of "good" strings that do not end in $2$, and let $c_n$ be the number of good strings that end in $2$.
We can see that $b_{n+1}=2b_n+c_n$. For we append a $0$ or a $1$ to a good string that does not end in $2$, or a $0$ to a good string that ends in $2$.
Note that $b_n+c_n=a_n$. So $b_{n+1}=b_n+a_n$ and $c_{n+1}=a_n$.
From $c_{n+1}=a_n$ we get $a_{n+1}-b_{n+1}=a_n$. Thus
$$b_{n+1}=a_{n+1}-a_n \quad\text{and therefore } \quad b_{n}=a_{n}=a_{n-1}.$$
Now substitute in $b_{n+1}=b_n+a_n$. We get
$$a_{n+1}=a_n=a_n-a+{n-1}+a_n,$$
which simplifies to
$$a_{n+1}=3a_n-a_{n-1}.$$
We can solve this with any of the standard methods, for example by finding the zeros of the characteristic polynomial.
Another way: Apart from the unfortunate restriction about $1$ not following $2$, we would have $a_{n+1}=3a_n$. How much does $3a_n$ overcount? It overcounts by including in the count the bad strings where we append a $21$ to a good string of length $n-1$. So, instantly
we get
$$a_{n+1}=3a_n-a_{n-1}.$$
Remark: In hindsight the problem is trivial. I wrote it up the way I did because in fact I first did it the clumsy way, a matrix version of the first approach.