  Let $\mathcal{G}_{\alpha}(X, G)$ be the $G$-gauge group over a space $X$
corresponding to a map $\alpha \colon X \to BG$. We compute the integral
cohomology of $B\mathcal{G}_{1}(S^2, SO(n))$ for $n = 3,4$. We also show that
the homology of $B\mathcal{G}_{1}(S^2, SO(n))$ is torsion free if and only if
$n\le 4$. As an application, we classify the homotopy types of $SO(n)$-gauge
groups over a Riemann surface for $n\le 4$.
