For a given function, $F(x,y,z,...)$, it's differential $\text{d}F$ is given by:
$$
\text{d}F = \left(\frac{\partial F}{\partial x}\right)_{y,z} \text d x +\left(\frac{\partial F}{\partial y}\right)_{x,z} \text d y + \left(\frac{\partial F}{\partial z}\right)_{x,y} \text d z +\; ...
$$
To say that a differential is an exact differential is to say that is if the differential of a function and hence is of the form given about.
For the case given:
$$
\mathrm dp(T,V)=\frac RV\,\mathrm dT+\left(\frac{2a}{V^2}-\frac{RT}{V^2}\right)\,\mathrm dV
$$
If $\mathrm dp$ is an exact differential, that would mean that:
$$
\left(\frac{\partial p}{\partial T}\right)_{V} = \frac RV\ \text{and } \left(\frac{\partial p}{\partial V}\right)_{T} = \left(\frac{2a}{V^2}-\frac{RT}{V^2}\right)
$$
There are two equivalent way to determine whether this is true, you can integrate the partial derivatives of $p$ to recover a form for $p$, or you can differentiate each term once more to so that both give identical values for the mixed second derivative.
Integration
Taking indefinite integrals of the suspected derivatives:
$$\int \frac RV\ \mathrm d T = \frac{RT}{V} + g(V) \\
\int \left(\frac{2a}{V^2}-\frac{RT}{V^2}\right) \mathrm d V = \frac{-2a+RT}{V} + h(T) \\
\to p(T,V) = \frac{RT-2a}{V} + c
$$
Differentiation
It is typically easier to compare the suspected derivative by differentiation. If $p$ is a true function of $T$ and $V$, by the symmetry of mixed derivatives:
$$
\frac{\partial }{\partial T }_V \left(\frac{\partial p }{\partial V }\right)_T = \frac{\partial }{\partial V }_T \left( \frac{\partial p }{\partial T } \right)_V
$$
Assuming:
$$ \left(\frac{\partial p}{\partial T}\right)_{V} = \frac RV\ \\
\to \frac{\partial }{\partial V }_T \left( \frac{\partial p }{\partial T } \right)_V = -\frac{R}{V^2}
$$
Assuming
$$ \left(\frac{\partial p}{\partial V}\right)_{T} = \left(\frac{2a}{V^2}-\frac{RT}{V^2}\right) \\
\to \frac{\partial }{\partial T }_V \left( \frac{\partial p }{\partial V } \right)_T = -\frac{R}{V^2}
$$
Both terms of the differential $\mathrm dp$ imply the same mixed second derivative, hence $\mathrm dp$ is an exact differential.