The website you took this from is just wrong. There isn't even a $g_1$ and a $g_2$ as $g$ maps to $\mathbb{R}$. The correct formula for $h = g \circ f$ is
$$J_h(x,y) = J_g(f(x,y))J_f(x,y) = \begin{pmatrix} \frac{\partial g}{\partial x}(f(x,y)) & \frac{\partial g}{\partial y}(f(x,y)) \end{pmatrix}\begin{pmatrix} \frac{\partial f_1}{\partial x}(x,y) & \frac{\partial f_1}{\partial y}(x,y) \\ \frac{\partial f_2}{\partial x}(x,y) & \frac{\partial f_2}{\partial y}(x,y) \end{pmatrix} = \begin{pmatrix} \frac{\partial g}{\partial x}(f(x,y)) \frac{\partial f_1}{\partial x}(x,y) + \frac{\partial g}{\partial y}(f(x,y)) \frac{\partial f_2}{\partial x}(x,y) & \frac{\partial g}{\partial x}(f(x,y)) \frac{\partial f_1}{\partial y}(x,y) + \frac{\partial g}{\partial y}(f(x,y)) \frac{\partial f_2}{\partial y}(x,y)\end{pmatrix},$$
where $J$ denotes the Jacobian. I'd advise to stay away from this site as they also seem to be confusing gradients with Jacobians as well as introducing the bad habit of using $f(x)$ as the name of a function instead of the function value at $x$.