It is known that $R[x]$ is a PID if and only if $R$ is a field. (Here $R$ is a commutative ring with a multiplicative identity.) This applies to $\mathbb Q[x,y]$ because $\mathbb Q[x,y] = \mathbb Q[y][x]$ is a polynomial ring over $R = \mathbb Q[y]$.
When $R$ is a field, this follows from the Euclidean algorithm:
If $f(x), g(x)$ are non-zero polynomials with coefficients in a field, then we can divide $g(x)$ into $f(x)$ with quotient $q(x)$ and remainder $r(x)$. I.e. we can write $$ f(x) = g(x)q(x) + r(x) $$ where $r(x) = 0$ or $\deg r < \deg g$.
If $I$ is a non-zero ideal of $R[x]$ and $R$ is a field then you can show by contradiction that $I = (g)$ where $g \in I$ is non-zero and of minimal degree.
Conversely, if $R$ is not a field then there is an element $a \in R$ which is neither zero nor invertible. Then you can show that $(a,x)$ is a non-principal ideal of $R[x]$ in exactly the same way that one shows that the ideal $(2,x)$ of $\mathbf Z[x]$ is non-principal.