The determination of the chain length.
If the chain is too short, the chain will come to be too tight, when the chain is on both front and rear on the largest sprocket.
If the chain is too long, the derailleur arm will be completely backwards when the chain is on the front and rear on the smallest sprocket.
The chain has the correct length when the chain guide wheel and and the chain tension wheel stand vertically relative to each other and the chain is on on the largest rear sprocket and on the smallest front chain wheel.
If all is well, the derailleur cage with this chain length can tension the chain with each sprocket combination.
If that fails, you may need to add or remove two links.
Still Failing this, then the capacity of the derailleur is not sufficient, and you have to replace the derailleur, or a chain wheel.