Here is my thought process here:
It's true that the best way to proceed will always be to stick one circle 'in one corner' of the rectangle and to try to fit the other circle 'in the opposite corner.' I take this for granted. It is very easy to understand where the center of a circle will go when the circle is 'tucked in a corner,' as both sides of the rectangle will be tangent to the circles. For example, if the rectangle is at coordinates $(0,0), (0,h), (l,0),$ and $(l,h)$, and a circle of radius $r_1$ is in the bottom-left corner, then the coordinates of its center will be $(r_1, r_1)$. If another circle, this one of radius $r_2$, is tucked in the top-right corner, the coordinates of it's center will be at $(l-r_2, h-r_2)$.
So one has to check two things: one has to make sure that both circles fit in the rectangle itself (without worrying about overlap), and then one has to make sure that the distance between the centers is greater than the sum of the radii.
So $2r_1, 2r_2 \leq l,h$ and $d[(r_1,r_1), (l-r_2,h-r_2)] \geq r_1 + r_2$ should be necessary and sufficient, where I let $d(\cdot, \cdot)$ denote the distance function.