I need some guidance in see how to use obstruction theory to prove this result.
Let $X$ be a closed $4$-manifold, let $E_1,E_2$ be two $U(2)$-bundles over it (I will think of them as vector bundle). Then $E_1\cong E_2$ are isomorphic if and only if $c_1(E_1)=c_1(E_2)$ and $c_2(E_1)=c_2(E_2)$
This is part of Theorem 1.4.20 in Gompf and Stipsicz's 4 Manifolds and Kirby Calculus. The proof is not given, instead the hint is to use obstruction theory.
Let $$f_i\colon X \to BU(2)$$ be the classifying map of $E_i$. I want to use obstruction theory to extend an homotopy skeleton by skeleton between $f_1$ and $f_2$. Clearly such homotopy exists on the $0$ and $1$ skeleton of $X$, being $BU(2)$ path-connected. Then the obstruction for extending to the $2$-skeleton of $X$ lies in $$H^2(X;\pi_2BU(2))=H^2(X;\pi_1U(2))=H^2(X;\Bbb Z)$$ which would be the right place for being a Chern class of something. In fact as far as I know the weak homotopy equivalence $U(1)\to K(\Bbb Z,2)$ can be identified with the first universal chern class, but still I'm not able to fit this in the big picture above.
The obstruction for extending the homotopy to the third skeleton vanish, since $\pi_2U(2)=0$, while the one for the fourth skeleton lies in $$H^4(X;\pi_3 U(2))=H^4(X;\Bbb Z)$$ which again, is the place where $c_2$ lives, but again I'm not able to identify it.
Can someone help me? Is there some general strategy when it comes to identify obstruction classes?
The cohomology ring $H^*BU(2)\cong\mathbb{Z}[c_1,c_2]$ is polynomial on two generators, namely the first and second Chern classes, $c_1\in H^2BU(2)$ and $c_2\in H^4BU(2)$. This gives you a map
$f_4=(c_1,c_2):BU(2)\rightarrow K(\mathbb{Z},2)\times K(\mathbb{Z},4)$
Now $K(\mathbb{Z},2)\simeq BU(1)$ so $H^*K(\mathbb{Z},2)\cong H^*BU(1)\cong\mathbb{Z}[c_1]$ is polynomial on a generator we can identify with the first Chern class and the map $c_1: BU(2)\rightarrow K(\mathbb{Z},2)\simeq BU(1)$ then identifies with the map $Bdet:BU(1)\rightarrow BU(1)$ classifying the determinant map $det:U(2)\rightarrow U(1)$). We have a homomorphism $i:U(1)\hookrightarrow U(2)$ satisfying $det\circ i=1_{U(1)}$, so in particular we get a section $Bi:K(\mathbb{Z},2)\simeq BU(1)\rightarrow BU(2)$ of $c_1\simeq Bdet$.
Since $K(\mathbb{Z},4)$ is 3-connected we conclude that for $*<4$ the map induced by $f_4$ in cohomology is the isomorphism
$$f_4^*=c_1^*:H^*(K(\mathbb{Z},2)\times K(\mathbb{Z},4))\cong H^*K(\mathbb{Z},2)\rightarrow H^*BU(2), \qquad *<4.$$
Since both the domain and codomain of $f$ are simply connected we conclude that $f_4$ is 3-connected.
Now $H^4K(\mathbb{Z},4)\cong \mathbb{Z}\{\iota_4\}$, generated by the fundamental class, and $H^5(\mathbb{Z},4)=0$. To see this second claim consider a cellular decomposition of $K(\mathbb{Z},4)$. To construct it we start with $S^4$ and attach a 6-cell to kill the class of the Hopf map $\eta_4\in \pi_4(S^4)$. This means that we have a 6-connected map $\Sigma^2\mathbb{C}P^2=S^4\cup_{\eta_4}e^6\hookrightarrow K(\mathbb{Z},4)$, so that $H^5K(\mathbb{Z},4)\cong H^5\Sigma^2\mathbb{C}P^2\cong H^3\mathbb{C}P^2=0$.
The point of this is that the map $c_2:BU(2)\rightarrow K(\mathbb{Z},4)$ induces an isomorphism in degree $4$ cohomology (by definition), and an epimorphism in degree $5$. Putting everything together we use that fact that $H^*K(\mathbb{Z},2)$ is free in every degree in which it is non-trivial, and apply the Kunneth theorem, finding that the map
$f_4^*=c_1^*\otimes c_2^*:H^*(\mathbb{Z},2)\times K(\mathbb{Z},4))\cong H^*(K(\mathbb{Z},2))\otimes H^*(\mathbb{Z},4))\rightarrow H^*BU(2)$
is an isomorphism in degrees $\leq 4$ and an epimorphism in degree $5$. In particular it is $5$-connected so we may conclude that $f_4:BU(2)\rightarrow K(\mathbb{Z},2)\times K(\mathbb{Z},4)$ presents the 4th stage of a Postnikov decomposition for $BU(2)$.
Therefore if $X$ is an 4-dimensional CW complex, so in particular any $4$-dimensional smooth manifold, then there is an isomorphism
$$(c_1,c_2)_*:[X,BU(2)]\xrightarrow{\cong} [X,K(\mathbb{Z},2)\times K(\mathbb{Z},4)]\cong H^2(X)\oplus H^4(X).$$
If we identify the left-hand side with $Vect_2^\mathbb{C}(X)$, the collection of rank 2 complex vector bundles over $X$, in the standrad way, i.e. by sending a bundle $E\rightarrow X$ to the homotopy class of a map $\alpha:X\rightarrow BU(2)$ that classifies it, then the isomorphism above sends $E$ to the pair $(c_1(E),c_2(E))\in H^2(X)\oplus H^4(X)$. That is
$$E\mapsto \alpha\mapsto (c_1\circ\alpha,c_2\circ\alpha)=(\alpha^*c_1,\alpha^*c_2)=(c_1(E),c_2(E))$$
and we conclude that first and second Chern classes completely characterise the rank 2 complex vectore bundle $E\rightarrow X$, up to bundle-isomorphism, whenever $X$ is a 4-dimensional $CW$ complex (or homotopy equivalent to one).