Use Lagrange Multipliers.
$\mathcal{L}=50L^{0.2}K^{0.8}-\lambda (1000-L-K)$
- Take first order condition with respect to K and set it to zero:
$50\times0.8\times L^{0.2}K^{-0.2}=-\lambda$
- Take first order condition with respect to L and set it to zero:
$50\times0.2\times L^{-0.8}K^{0.8}=-\lambda$
- Take first order condition with respect to $\lambda$ and set it to zero:
$1000=L+K$
From the first two equations, we have $50\times0.8\times L^{0.2}K^{-0.2}=50\times0.2\times L^{-0.8}K^{0.8}$
$\Rightarrow 4L=K$
Plug this into the third equation, we have $4L+L=1000 \Rightarrow L=200$
And therefore $K=1000-L=1000-200=800$.
You will need $L=200$ and $K=800$ to maximize the profit.