For a given node $a$, let the number of nodes in its left sub-tree be $l$ and that on the right sub-tree be $r$. Based on the given constraint $\mid l - r \mid \leq 2.$ For simplicity we can assume $l \geq r$ as this should be similar to assuming $ r \geq l$ and won't change the answer. This gives $r \geq l - 2.$
Now, minimum number of nodes in the sub-tree rooted at $a = l + r + 1$
$\qquad = l + l - 2 + 1$
$\qquad = 2l - 1\qquad \to (1).$
Now, lets assume the height of the sub-tree rooted at $a$ to be $h$ and this gives the height of its left (or right) sub-tree $ = h - 1.$
If we denote the minimum number of nodes in a binary tree of height $h$ satisfying the given conditions by $N(h),$ we get
$N(h) = 2 N(h-1) - 1$
We know $N(1) = 2.$
So, from $N(h) = 2N(h-1)-1$ we get
$N(2) = 2 . 2 -1 = 3, N(3) = 5, N(4) = 9, N(5) = 17.$
We can see that $N(h) = 2^{h-1} +1.$
(Formal proof given below)
$N(h) = 2N(h-1)-1 = 2 \left[2 N(h-2) -1 \right] - 1 $
$\qquad = 2^2 \left[N(h-2) \right] - 2 -1 $
$\qquad = 2^2 \left[2N(h-3) - 1 \right] - 2^1 -1 $
$\qquad = 2^3 \left[N(h-3) \right] -2^2- 2 -1 $
$\qquad \vdots$
$\qquad = 2^{h-1} \left[N(1) \right] - \left[2^{h-2} +\ldots +2^2+ 2^1 +2^0 \right]$
$\qquad = 2^{h-1} \left[2 \right] - \left[2^{h-1} - 1\right]$
$\qquad = 2^{h-1}+1$