Do not do it the other way round the second time: that just undoes the first integration by parts and leaves you with nothing useful. Do it the same way round, and solve for the integral. Here’s how it works out with your example.
If you begin with the substitutions $u=\cos x$, $dv=e^{-x}dx$, you get $du=-\sin x dx$, $v=-e^{-x}$, and
$$\int e^{-x}\cos x dx=-e^{-x}\cos x-\int e^{-x}\sin xdx\;.$$
If you repeat the procedure using the same rule, i.e., with the substitutions $u=\sin x$, $dv=e^{-x}dx$, you get $du=\cos x dx$, $v=-e^{-x}$, and
$$\int e^{-x}\cos x dx=-e^{-x}\cos x+e^{-x}\sin x-\int e^{-x}\cos x dx\;.$$
Now just solve for the integral:
$$2\int e^{-x}\cos x dx=-e^{-x}\cos x+e^{-x}\sin x\;,$$
and
$$\int e^{-x}\cos x dx=\frac12e^{-x}(\sin x-\cos x)+C\;.$$
If you do it the other way round the second time, with $u=e^{-x}$ and $dv=\sin x dx$, you get $du=-e^{-x}dx$, $v=-\cos x$, and
$$\int e^{-x}\cos x dx=-e^{-x}\cos x-\left(-e^{-x}\cos x-\int e^{-x}\cos x\right)=\int e^{-x}\cos x dx\;,$$
which is true, but completely useless.
Best Answer
The way I see it, when you differentiate an inverse trigonometric function, you don't get another inverse trigonometric function. Instead you get "simpler" functions like $1/(1 + x^2)$ or $1/\sqrt{1-x^2}$. This does not typically happen with the antiderivative of such functions.
Similarly, when you differentiate a logarithmic function, the logarithm disappears.
So, when using integration by parts $\int u dv = uv - \int v du$, it makes sense to select the inverse trigonometric or logarithmic function to be the one that is the $u$ term.
In the case of algebraic, trigonometric and exponential functions both integration and differentiation don't change the nature of the function, so they come later in the ILATE order.
Of course, this is just intuition and there are examples where you can violate this so called rule and still integrate by parts without any problems.