Let $X_i$ be the number of potential draws from pile $i\in \\{0,1\\}$ until the other pile is empty. Then $$ \mathsf{P}(X_i=k)=\binom{n+k-1}{k}\left(\frac{1}{2}\right)^{n+k}. $$ Letting $Y$ denote the number of remaining coins in a non-empty pile after the other pile has been emptied, for $m\in\\{1,\ldots,n\\}$ one gets \begin{align} \mathsf{P}(Y=m)&=\mathsf{P}(Y=m,X_1