For the fundamental group, one considers homotopies with fixed end-points, or at least homotopies of closed curves (continuous maps $h \colon S^1\times [0,\,1] \to X$ leave less room for mistakes).
That means in your homotopy you'd need $h(0,t) = h(1,t)$ for all $t \in [0,\,1]$.
Since $f$ winds around the origin only once, and $g$ twice, that condition cannot be satisfied, and for your $h$, you have $h(0,t) = h(1,t)$ only for $t = 0$ and $t = 1$.