We will use the method of integration by parts. Using the $ILATE$ rule, we choose $x^{2}$ as first function and $sin(x)$ as the second function.
By the definition of integration by parts, $\int I\times II$ $dx$ $=$ $I\times\int II$ $dx$ $-$ $\int (\frac{d}{dx}(I)\times \int IIdx)$ $dx$ (Reference: Integration by parts)
Let the answer de denoted by $I_{1}$
$\therefore$ $\int x^{2}sin(x)dx=x^{2}\times \int sin(x)dx-\int 2x(-cos(x))dx$ ----(1)
Now, $\int xcos(x)dx=xsin(x)-\int sinxdx$ $=$ $xsin(x)+cos(x)$ -----(2)
Putting the value of (2) in (1), we get
$\therefore$ $\int x^{2}sin(x)dx=x^{2}(-cos(x))+2(xsin(x)+cos(x))$ $=$ $cos(x)(2-x^{2})+2xsin(x)$
Substituting the limits, we get : $I_{1}=\left [ (0+\pi)-(2+0) \right ]=\pi-2$
Option C is correct.