OP has the correct idea, but have overlooked some details. Note that both functions have limited support. Then, the correlation is
$$C(t)=\int_{-\infty}^{\infty} u(\tau+t)\sin(\tau)\big[u(\tau)-u(\tau-2)\big]\,d\tau=\int_{-\infty}^{\infty} \sin(\tau)\underbrace{u(\tau+t)\big[u(\tau)-u(\tau-2)\big]}_{v(\tau)}\,d\tau\,.$$
This means that the integral limits depend on $v(\tau)$ and not only on $x(\tau)$ as OP did. We have that
$$v(\tau)=u(\tau+t)\big[u(\tau)-u(\tau-2)\big]=\begin{cases}1&\tau\in\big[0,2\big)\text{ and } \tau\geq-t\\0&\text{otherwise}\end{cases}\,\,.
$$
In other words, if $-t\geq2$, $v(\tau)=0\,\forall\tau$. Equivalently,
$$v(\tau)=u(\tau+t)\big[u(\tau)-u(\tau-2)\big]=\begin{cases}1&\tau\in[\max\{0,-t\},\max\{2,-t\}\big)\\0&\text{otherwise}\end{cases}\,\,.
$$
Now we can substitute the integration limits in $C(t)$ and obtain
$$\begin{align}
C(t)&=\int_{\max\{0,-t\}}^{\max\{2,-t\}} \sin(\tau)\,d\tau=-\cos(\tau)\bigg|_{\tau=\max\{0,-t\}}^{\tau=\max\{2,-t\}}\\
&=\cos\big(\max\{-t,0\}\big)-\cos\big(\max\{-t,2\}\big)\\
&=\cos\big(\min\{t,0\}\big)-\cos\big(\min\{t,-2\}\big)\,,
\end{align}$$
where I use the fact that $\max\{-x,-y\}=-\min\{x,y\}$ and that cosine is an even function.
This result can also be rewritten in terms of the step function if required, noting that
$$C(t)=\begin{cases}0&t<-2\\\cos(t)-\cos(2)&t\in[-2,0)\\1-\cos(2)&t\geq0\end{cases}$$
Thus, one possible expression (as there are multiple) is
$$C(t)=u(t+2)\big[\cos(t)-\cos(2)\big]-u(t)\big[\cos(t)-1\big]\,.$$