There is a stupid answer which is equivalence classes of G-bundles with connection on M are the same as homotopy classes of maps $M \to BG$. That is as long as two G-bundles with connection are considered equivalent if they have the same underlying principal bundle. This isn't meant to be a serious answer, just point out that your question is not exactly well posed.
But more seriously, there is a stack which represents G-principal bundles with connections. It even has a nice form:
$$ Bun_G^\nabla = [ \Omega^1( - ; \mathfrak{g}) / G]$$
Maps from M to this stack are principal G-bundles with connection.
The problem with this stack is that it is not presentable. It is not covered by a manifold. It can be describe as a quotient stack, but thing you act on is the sheaf $\Omega^1(-; \mathfrak{g})$ of Lie algebra valued 1-forms. This is a sort of generalized manifold (in a loose sense), but this sheaf is not representable (great exercise!).
If it was a presentable stack, then we could take its classifying space (there are several ways to do this, e.g take the realization of the simplicial manifold obtained by iterated fiber products of the covering manifold). Homotopy classes of maps to this space could then be related to certain isomorphism classes of maps to the stack. But since $Bun^\nabla_G$ is not presentable we are kinda stuck.
You could ask, well what happens if I replace $\Omega^1(-; \mathfrak{g})$ with an honest topological space that is the best approximation to it (for maps into it). Well it turns out the space which best approximates $\Omega^1(-; \mathfrak{g})$ is the point. So you get the classifying space of the stack $[pt/G]$ which is just the usual BG.
A left-invariant Riemannian metric on Lie group is a special case of homogeneous Riemannian manifold, and its differential geometry (geodesics and curvature) can be described in a quite compact form. I am most familiar with the description in 28.2 and 28.3 of here of covariant derivative and curvature.
But on a Lie group itself there is an explicit description of Jacobi fields available for
right invariant metrics (even on infinite dimensional Lie groups) in section 3 of:
- Peter W. Michor: Some Geometric Evolution Equations Arising as Geodesic Equations on Groups of Diffeomorphism, Including the Hamiltonian Approach. IN: Phase space analysis of Partial Differential Equations. Series: Progress in Non Linear Differential Equations and Their Applications, Vol. 69. Birkhauser Verlag 2006. Pages 133-215. (pdf).
I shall now describe the results (which go back to Milnor and Arnold). For detailed computations, see the paper.
Let $G$ be a Lie group with Lie algebra
$\def\g{\mathfrak g}\g$.
Let $\def\x{\times}\mu:G\x G\to G$ be the multiplication, let $\mu_x$ be left
translation and $\mu^y$ be right translation,
given by $\mu_x(y)=\mu^y(x)=xy=\mu(x,y)$.
Let $\langle \;,\;\rangle:\g\x\g\to\Bbb R$ be a positive
definite inner product. Then
$$\def\i{^{-1}}
G_x(\xi,\eta)=\langle T(\mu^{x\i})\cdot\xi,
T(\mu^{x\i})\cdot\eta)\rangle
$$
is a right invariant Riemannian metric on $G$, and any
right invariant Riemannian metric is of this form, for
some $\langle \;,\;\rangle$.
Let $g:[a,b]\to G$ be a smooth curve.
In terms of the right logarithmic derivative $u:[a,b]\to \g$ of $g:[a,b]\to G$, given by
$u(t):= T_{g(t)}(\mu^{g(t)\i}) g_t(t)$,
the geodesic equation has the expression
$$ \def\ad{\text{ad}}
\partial_t u = u_t = - \ad(u)^{\top}u\,,
$$
where $\ad(X)^{\top}:\g\to\g$ is the adjoint of $\ad(X)$ with respect to the inner product $\langle \;,\; \rangle$ on $\g$, i.e.,
$\langle \ad(X)^\top Y,Z\rangle = \langle Y, [X,Z]\rangle$.
A curve $y:[a,b]\to \g$ is the right trivialized version of a Jacobi field along the geodesic $g(t)$ described by $u(t)$ as above iff
$$
y_{tt}= [\ad(y)^\top+\ad(y),\ad(u)^\top]u
- \ad(u)^\top y_t -\ad(y_t)^\top u + \ad(u)y_t\,.
$$
Continued:
For connected $G$, the right invariant metric is biinvariant iff $\ad(X)^\top = -\ad(X)$.
Then the geodesic equation and the Jacobi equation reduces to
$$
u_t = \ad(u)u = 0,\qquad y_{tt} = \ad(u)y_t
$$
Now we can look at examples.
If $G=SU(2)$ then $\g=\mathfrak{sl}(3,\mathbb R)$ and we can take an arbitrary inner product on it.
(Maybe, I will continue if I have more time in the next few days).
Best Answer
This is something of an exercise is unwinding the definitions, but there's an interesting twist to it as well, so here's an outline of an answer:
Let $G$ be a connected $3$-dimensional Lie group (not necessarily unimodular) endowed with a left-invariant metric $q$. Let $\eta:TG\to\mathbb{R}^3$ be a left-invariant 1-form on $G$ such that $q = {^t}\eta\,\eta = {\eta_1}^2+{\eta_2}^2+{\eta_3}^2$ and fix an orientation on $G$ by requiring that $\eta_1\wedge\eta_2\wedge\eta_3$ be the oriented volume form. Regard the principal right $\mathrm{SO}(3)$-bundle $P_{SO}$ as the set of linear, oriented $q$-isometries $u:T_gG\to\mathbb{R}^3$, this is a trivial bundle isomorphic to $G\times\mathrm{SO}(3)$, where one identifies $(g,a)\in G\times\mathrm{SO}(3)$ with the element $u= a^{-1}\circ\eta_g:T_gG\to\mathbb{R}^3$ in $P_{SO}$. An automorphism of $P_{SO}=G\times\mathrm{SO}(3)$ is a smooth mapping of the form $\Phi(k,a)= \bigl(k,\ell(k)a\bigr)$, where $\ell:G\to\mathrm{SO}(3)$ is smooth, i.e., an element of the gauge group. It's useful to consider a slightly larger group, the extended automorphisms, which are mappings of the form $\Phi(k,a)= \bigl(gk,\ell(k)a\bigr)$ where $g\in G$ is fixed and $\ell:G\to\mathrm{SO}(3)$ is smooth.
A connection form $\omega$ on $P_{SO}$ is of the form $$ \omega = a^{-1}\,\mathrm{d}a + a^{-1}\,\overline{\omega} \,a $$ where $\overline{\omega} = - {^t}\overline{\omega}$ is a $1$-form on $G$ with values in $\mathfrak{so}(3)$. If $[\omega]$ belongs to $\mathscr{B}^G$, then, for each $g\in G$, there exists a smooth map $\ell_g:G\to\mathrm{SO}(3)$ so that $$ L_g^*\overline{\omega} = \ell_g^{-1}\,\mathrm{d}\ell_g + \ell_g^{-1}\,\overline{\omega}\,\ell_g\,,\tag1 $$ where $L_g:G\to G$ is left-multiplication by $g\in G$. Of course, this implies that $$ L_g^*\bigl(\mathrm{d}\overline\omega + \overline\omega\wedge\overline\omega\bigr) = \ell_g^{-1}\,\bigl(\mathrm{d}\overline\omega + \overline\omega\wedge\overline\omega\bigr)\,\ell_g\tag2 $$
For $x\in\mathbb{R}^3$, let $\langle x\rangle\in\mathfrak{so}(3)$ satisfy $\langle x\rangle y = x\times y$. Note the useful identity $a^{-1}\langle x\rangle a = \langle a^{-1}x\rangle$ for $a\in\mathrm{SO}(3)$. It follows that there is a smooth mapping $F:G\to M_{3\times3}(\mathbb{R})$ such that $$ \mathrm{d}\overline\omega + \overline\omega\wedge\overline\omega = \bigl\langle F\,{\ast}\eta\bigr\rangle\qquad\text{where}\quad {\ast}\eta = \begin{pmatrix}\eta_2\wedge\eta_3\\\eta_3\wedge\eta_1\\\eta_1\wedge\eta_2\end{pmatrix}. $$ Since $\eta$ is left-invariant, we have $L_g^*({\ast}\eta) = {\ast}\eta$, so equation (2) becomes $$ L_g^*F = \ell_g^{-1} F.\tag3 $$ Of course, this implies $L_g^*\bigl({^t}FF\bigr) = {^t}FF$, i.e., the symmetric matrix ${^t}FF$ is constant. Consequently, $(\det F)^2 = \det\bigl({^t}\!FF\bigr)$ is constant. Since $G$ is connected, $\det F$ is constant. Note that the rank of $F$ is also constant. It follows that there is a matrix $R\in\mathrm{SO}(3)$ such that ${^t}\!(FR)(FR)$ is a constant diagonal matrix. Replacing $\eta$ by $R^{-1}\eta$, we can reduce to the case that ${^t}\!FF$ itself is diagonal, with nonnegative and non-increasing entries down the diagonal.
The special cases in which $F$ has rank $0$ or $1$ proceeds by a separate argument (see the remark below), so suppose $F$ has rank at least $2$. Then $F$ can be written in the form $F = QD$ where $D$ is a constant diagonal matrix with at least 2 positive entries and $Q:G\to SO(3)$ is smooth. Equation (3) then implies that $L_g^*Q = \ell_g^{-1}\,Q$, i.e., $\ell_g = Q(L_g^*Q)^{-1}$. In particular $\ell_g:G\to\mathrm{SO}(3)$ is unique and smooth in $g$. Thus, for any $g\in G$, equation (1) can be re-arranged to become $$ L_g^*\bigl(Q^{-1}\,\mathrm{d}Q + Q^{-1}\overline\omega Q\bigr) = Q^{-1}\,\mathrm{d}Q + Q^{-1}\overline\omega Q, $$ i.e., the $1$-form $\hat\omega = Q^{-1}\,\mathrm{d}Q + Q^{-1}\overline\omega Q$ on $G$ is left-invariant. Consequently, the connection form $$ \tilde\omega = a^{-1}\,\mathrm{d}a + a^{-1}\hat\omega a $$ on $P_{SO} = G\times\mathrm{SO}(3)$ (which is gauge equivalent to $\omega$) is invariant under $L_g\times \mathrm{id}_{\mathrm{SO}(3)}$.
Thus, setting $\Phi(k,a) = (k,Qa)$, we see that $\Phi^*\omega = \tilde\omega$, so setting $$\phi(g) = \Phi\circ(L_g\times \mathrm{id}_{\mathrm{SO}(3)})\circ\Phi^{-1}, $$ we have that $\phi(g)^*\omega = \omega$, and $\phi$ is a homomorphism of $G$ into the extended automorphism group of $P_{SO}$.
N.B. When $F$ has rank $0$ or $1$, there is no well-defined $Q$, so there's not a well-defined $\hat\omega$. Moreover, $\ell_g$ is not uniquely defined by (1), so a different argument is needed. (This is the case in which the connection $\omega$ itself has nontrivial automorphisms.) The analysis in these cases is left to the reader.