freeness over subrings Let $A=\mathbb{Z}[X]$ and $B=\mathbb{Z}[Y_1,\dots,Y_n]$ be polynomial rings over the ring of integers, related by a homomorphism $f\colon A\rightarrow B$, $X\mapsto f(Y_1,\dots,Y_n)$. I want to understand the freeness of $B$ over the subring $f(A)$ in terms of $f(Y_1,\dots,Y_n)$ explicitly as possible.
Question: What is the condition on $f(Y_1,\dots,Y_n)$ for $B$ being free over $A$?
What I have found is: If $B$ is of one variable over $\mathbb{Z}$, namely $n=1$, then, putting
$f(Y_1)= a_lY_1^l+\text{(lower terms)}$ with $l\geq 1$, we have
$$B \text{ is free over } A \Leftrightarrow a_l=\pm 1.$$
Proof: If $a_l=\pm 1$, then by the division algorithm iterated, every $g(Y_1)$ can be written in the form $g(Y_1)=r_k(Y_1)f(Y_1)^k+\cdots+r_0(Y_1)$ with $\mathrm{deg} (r_i)\leq l-1$ uniquely, hence $B$ is a free $A$-module with basis $1,Y_1,\dots,Y_1^{l-1}$.
Conversely, if $B$ is free over $A$, so is $B\otimes_{\mathbb{Z}} \mathbb{F}_p$ over $A\otimes_{\mathbb{Z}} \mathbb{F}_p$ and the rank is preserved. This rank is exactly $l$ when $p$ does not divide $a_l$. If $a_l$ is not a unit, then for a prime $p$ dividing $a_l$, the rank of $B\otimes \mathbb{F}_p$ over $A\otimes \mathbb{F}_p$ is less than $l$, so $B$ is not free over $A$.
For multi-variables, the former part of the proof generalizes but I found the rank argument is not available and it is difficult to show the non-freeness. For example, is $B=\mathbb{Z}[Y_1,Y_2]$ free over the subring $\mathbb{Z}[2Y_1^2+3Y_2^3]$? Any help is appreciated. If possible, I also want to see the conditions on $f(Y_1,\dots,Y_n)$ for $B$ to be flat or faithfully-flat over $A$. Thank you for your interest.

As in the one variable case, if $f$ is monic in one of the variables (possibly after a change of variable) you got freeness. For example, instead of $2Y_1^2+3Y_2^3$, you had $2Y_1^2-3Y_2^2$, after a change of variables, you can make it monic. (Substitute $Y_1+2Y_2$ for $Y_1$.)
