The Milnor-Moore theorem states that for path-connected H-spaces $X$, $H_*(X;\Bbb Q)$ is a free graded-commutative algebra on $\pi_*(X)\otimes \Bbb Q$. I am asked to use this to compute $\pi_i(S^n)\otimes \Bbb Q$.
I know another way of computing $\pi_i(S^n)\otimes \Bbb Q$ which does not use the Milnor-Moore theorem. I'm not sure how one would use this theorem since the only spheres which are H-spaces are in dimensions 1,3 and 7.
Indeed, you can only use this theorem for $S^1$, $S^3$ and $S^7$ since these are the only three that are connected H-spaces (don't forget that $S^0 = \mathbb{Z}/2\mathbb{Z}$ is an H-space too, but it's not path-connected). You have (let $n \in \{1,3,7\}$): $$H_i(S^n; \mathbb{Q}) = \begin{cases} \mathbb{Q} & i = 0,n; \\ 0 & \text{otherwise.} \end{cases}$$
The theorem tells you that this is a free graded-commutative algebra on some graded vector space $V$. Clearly you must have a generator $e \in V_n$ of degree $V$ corresponding to the fundamental class, it cannot be written as a product of lower-degree elements. Since $n$ is odd, $e^2 = 0$. There is nothing else in the homology, so you get that $V$ is one-dimensional spanned by an element of degree $n$, and thus for $n \in \{1,3,7\}$: $$\pi_i(S^n) \otimes \mathbb{Q} = \begin{cases} \mathbb{Q} & i = n; \\ 0 & \text{otherwise.} \end{cases}$$
I don't know what the author of the problem had in mind precisely, but note that you can't directly apply the theorem to even-dimensional spheres in any case. Indeed if $H_*(S^{2n})$ were a free graded-commutative algebra, there would have to be a generator $e$ in degree $2n$ corresponding to the fundamental class. But then $e^2 \in H_{4n}(S^{2n})$ would be a nonzero element... Which is not possible. For odd-dimensional spheres you get the same result as for the ones that are H-spaces ($\pi_{2n+1}(S^{2n+1}) \otimes \mathbb{Q} = \mathbb{Q}$ and zero otherwise).