Solution (source code)

= Solution

By the <Markov property>, all factors in the stationary <likelihood function> that involve $X_2$ are the transitions from $X_1$ to $X_2$ and from $X_2$ to $X_3$. Hence conditioning on later observations adds no information once the two neighbors are known. Writing $u=X_2-\mu$, $u_1=x_1-\mu$ and $u_3=x_3-\mu$, its conditional density is proportional to
$$
\exp\left[-\frac{(u-\phi u_1)^2+(u_3-\phi u)^2}{2\sigma^2}\right].
$$
The quadratic coefficient of $u$ is $1+\phi^2$ and the linear coefficient is $-2\phi(u_1+u_3)$. <Completing the square> therefore gives the <Gaussian AR1 bridge>
$$
\boxed{X_2\mid X_1=x_1,X_3=x_3,\ldots,X_n=x_n\sim N\left(\mu+\frac{\phi(x_1+x_3-2\mu)}{1+\phi^2},\frac{\sigma^2}{1+\phi^2}\right).}
$$
Here $\sigma^2$ is the innovation variance, not the marginal stationary variance.