The Brahmagupta identity $(x^2+ry^2)(z^2+rt^2)=(xz-ryt)^2+r(xt+yz)^2=(xz+ryt)^2+r(xt-yz)^2$ shows that for an arbitrary fixed $r$ the set numbers of the form $x^2+ry^2$ is closed under the operation of multiplication.
Let $p,r;x,y∈\mathbb{Z}$. Find all pairs $(p,r)$ such that, for fixed $p$ and $r$, the set of numbers of the form $px^2+ry^2$ is closed under multiplication.
If $p=l(la^2+kb^2)$ and $r=k(la^2+kb^2)$ (all variables are integers), then the set of numbers of the form $px^2+ry^2$ is closed under the operation of multiplication. To check, it suffices to use the Brahmagupta identity twice:
$$(l(la^2+kb^2)x^2+k(la^2+kb^2)y^2)(l(la^2+kb^2)z^2+k(la^2+kb^2)t^2)=$$
$$=(la^2+kb^2)(la^2+kb^2)(lx^2+ky^2)(lz^2+kt^2)=$$
$$=l(la^2+kb^2)(laxz-kayt-kbxt-kbyz)^2+k(la^2+kb^2)(laxt+layz+lbxz-kbyt)^2.$$
I failed to prove that other pairs $(p,r)$ do not exist.
There are more primitive forms that do this than just the principal ones. Meaning $\gcd(a,b,c)=1$ in $f(x,y) = ax^2 + bxy + c y^2 . $
In general, you ought to consider class number three or, at least, divisible by three.
For example, discriminant $-23$ with $2 x^2 + xy + 3 y^2$ to be multiplied by $2 z^2 + zw + 3 w^2.$
$$ u = -xz + xw + yz +2yw $$
$$ v = xz + xw + yz - yw $$
$$ \left(2x^2 + xy + 3y^2 \right) \left(2 z^2 +zw + 3w^2 \right) = 2u^2 + uv + 3v^2 $$