I don't know of a combinatorial solution, but I do know a trick...
The number of $n$-step walks starting at $(x,y)$ that don't leave the grid is obviously the total number of $n$-step walks ($4^n$) times the probability $p_n(x,y)$ that a random $n$-step walk started at $(x,y)$ doesn't leave the grid.
What is that probability? Obviously, $p_0(x,y) = \chi(x,y)$, where $\chi(x,y)$ equals $1$ inside the grid and $0$ on the points surrounding it. For higher $n$, we have the recurrence relation $$p_{n+1}(x,y) = \chi(x,y) \frac{p_n(x-1,y) + p_n(x+1,y) + p_n(x,y-1) + p_n(x,y+1)}{4}.$$
Except for the $\chi(x,y)$ term, this is almost a convolution, and by making use of the fact that the grid is rectangular, we can get rid of the unwanted term by extending $p_0$ suitably beyond the edges of the grid.
Here it turns out to be much more convenient to let the grid extend from $(1,1)$ to $(a-1, b-1)$, so I'm going to adopt that convention, and then define $p_0(x,y) = f(x)g(y)$, where $$f(x) = \begin{cases} \phantom{+}0 & \text{if }x = ka, k \in \mathbb Z \\ \phantom{+}1 & \text{if }(2k+0)a < x < (2k+1)a, k \in \mathbb Z \\ -1 & \text{if }(2k+1)a < x < (2k+2)a, k \in \mathbb Z \end{cases}$$
$$g(y) = \begin{cases} \phantom{+}0 & \text{if }y = kb, k \in \mathbb Z \\ \phantom{+}1 & \text{if }(2k+0)b < y < (2k+1)b, k \in \mathbb Z \\ -1 & \text{if }(2k+1)b < y < (2k+2)b, k \in \mathbb Z.\end{cases}$$
It is then not hard to show that, even if we drop the $\chi(x,y)$ term from the recurrence, $p_n(x,y) = 0$ whenever $x$ is divisible by $a$ or $y$ is divisible by $b$. Thus, we can calculate $p_{n+1}$ for $n \ge 0$ via the convolution $p_{n+1} = p_n * K$, i.e. $$p_{n+1}(x,y) = \sum_{u,v \in \mathbb Z} p_n(x-u,y-v) K(u,v),$$ where the kernel $K$ is given by $K(1,0) = K(0,1) = K(-1,0) = K(0,-1) = \frac 1 4$ and $K(u,v) = 0$ for all other values of $u$ and $v$.
Why would we want to do that? Well, it just happens that convolutions of discrete periodic functions can be efficiently calculated using discrete Fourier transforms. In particular, letting $\tilde p_n$ and $\tilde K$ denote the Fourier transforms of $p_n$ and $K$, we have $$\tilde p_n = \tilde p_{n-1} \tilde K = \tilde p_0 \tilde K^n,$$ where the multiplication is simply done pointwise.
We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
\begin{align*}
&A=(1,0)\quad\to x^1y^0\\
&B=(1,1)\quad \to x^1y^1\\
&C=(1,-1)\ \to x^1y^{-1}\\
\end{align*}
To go one step either $A$ or $B$ or $C$ is encoded as
\begin{align*}
x+xy+\frac{x}{y}
\end{align*}
Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
\begin{align*}
[x^{40}y^{0}]\left(x+xy+\frac{x}{y}\right)^{40}\tag{1}
\end{align*}
where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.
We obtain
\begin{align*}
\color{blue}{[x^{40}y^{0}]}&\color{blue}{\left(x+xy+\frac{x}{y}\right)^{40}}\\
&=[x^{40}y^0]x^{40}\left(1+y+\frac{1}{y}\right)^{40}\\
&=[y^0]\sum_{k=0}^{40}\binom{40}{k}\left(y+\frac{1}{y}\right)^k\tag{2}\\
&=[y^0]\sum_{k=0}^{40}\binom{40}{k}\sum_{j=0}^k\binom{k}{j}y^jy^{-(k-j)}\\
&=\sum_{k=0}^{40}\binom{40}{k}[y^k]\sum_{j=0}^k\binom{k}{j}y^{2j}\tag{3}\\
&=\sum_{k=0}^{20}\binom{40}{2k}[y^{2k}]\sum_{j=0}^{2k}\binom{2k}{j}y^{2j}\tag{4}\\
&\,\,\color{blue}{=\sum_{k=0}^{20}\binom{40}{2k}\binom{2k}{k}}\tag{5}
\end{align*}
in accordance with the result of @JeanMarie.
Comment:
In (2) we apply the rule $[x^p]x^q=[x^{p-q}]$ and apply the binomial theorem to $\left(1+\left(y+\frac{1}{y}\right)\right)^{40}$.
In (3) we apply the rule $[y^p]y^q=[y^{p-q}]$ again.
In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.
In (5) we finally select the coefficient of $y^{2k}$.
Note:
The coefficients of $x^0$ in the expansion of $\left(x+1+x^{-1}\right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.
Best Answer
We need to take a total of 2 vertically up steps and 2 steps towards right (i.e., we have 2 different types of steps), that we can take in any order: we can do it in $\dfrac{(2+2)!}{2!2!}=6$ ways.
Generalizing, let's denote a single up step by a red object and right step by a blue object. Then number of ways to construct a path of total m+n length which contains m up and n right steps is exactly same as number of ways to sort / permute m red and n blue objects, which is $\dfrac{(m+n)!}{m!n!}$. Here, we have $m=n=2$.