Let $ABCD$ be a rectangle with: $AB=a$, $BC=b$. Inside the rectangle we have to exteriorly tangents circles such that one is tangent to the sides $AB$ and $AD$,the other is tangent to the sides $CB$ and $CD$.

1. Find the distance between the centers of the circles(using $a$ and $b$).
2. When the radiums of both circles change the tangency point between both of them changes, and describes a locus. Find that locus.
### Part 1: Distance Between the Centers of the Circles

1. Let the radius of the lower left circle be \( r_1 \) and the radius of the upper right circle be \( r_2 \). The centers of these circles are at \((r_1, r_1)\) and \((a - r_2, b - r_2)\) respectively.
2. The horizontal component of the distance between the centers is \( x = a - r_1 - r_2 \).
3. The vertical component of the distance between the centers is \( y = b - r_1 - r_2 \).
4. The total distance between the centers is given by the Pythagorean theorem:
   \[
   \sqrt{x^2 + y^2} = \sqrt{(a - r_1 - r_2)^2 + (b - r_1 - r_2)^2}
   \]
5. Since the circles are tangent to each other, the distance between their centers is equal to the sum of their radii:
   \[
   \sqrt{(a - r_1 - r_2)^2 + (b - r_1 - r_2)^2} = r_1 + r_2
   \]
6. Let \( S = r_1 + r_2 \). Then we have:
   \[
   \sqrt{(a - S)^2 + (b - S)^2} = S
   \]
7. Squaring both sides, we get:
   \[
   (a - S)^2 + (b - S)^2 = S^2
   \]
8. Expanding and simplifying:
   \[
   a^2 - 2aS + S^2 + b^2 - 2bS + S^2 = S^2
   \]
   \[
   a^2 + b^2 - 2(a + b)S + S^2 = 0
   \]
9. This simplifies to the quadratic equation:
   \[
   S^2 - 2(a + b)S + (a^2 + b^2) = 0
   \]
10. Solving this quadratic equation using the quadratic formula \( S = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \):
    \[
    S = \frac{2(a + b) \pm \sqrt{4(a + b)^2 - 4(a^2 + b^2)}}{2}
    \]
    \[
    S = (a + b) \pm \sqrt{2ab}
    \]
11. Since \( S \) must be less than both \( a \) and \( b \), we choose the negative root:
    \[
    S = (a + b) - \sqrt{2ab}
    \]
    \[
    S = (\sqrt{a} - \sqrt{b})^2
    \]

### Part 2: Locus of the Tangency Point

1. From the value of \( S \), we have \( x = a - S \) and \( y = b - S \).
2. Let the distance from the tangency point to \( AD \) be \( p \) and the distance from the tangency point to \( AB \) be \( q \).
3. Using the corrected formulas:
   \[
   p = \frac{r_1 x}{S} + r_1 = \frac{r_1 (a - S)}{S} + r_1
   \]
   \[
   q = \frac{r_1 y}{S} + r_1 = \frac{r_1 (b - S)}{S} + r_1
   \]
4. It follows that:
   \[
   q = p + (b - a)
   \]
5. The locus must be a line segment that is included in the equation above. To find the full locus, we must find the endpoints.
6. Note that \( p \) and \( q \) are both maximized when \( r_1 \) is maximized. Let \( m = \min(a, b) \). Then \( \max r_1 = \frac{m}{2} \) so:
   \[
   \max p = \frac{m}{2} + \frac{r_1 (a - S)}{S} = \frac{m}{2} + \sqrt{2ab} - b
   \]
   \[
   \max q = \frac{m}{2} + \frac{r_1 (b - S)}{S} = \frac{m}{2} + \sqrt{2ab} - a
   \]
7. Similarly, \( p \) and \( q \) are minimized when \( r_2 \) is maximized, which is when \( r_1 = S - \frac{m}{2} \).

8. Since any point between the endpoints is in the locus, the locus consists of the line segment connecting:
   \[
   \left( a - \frac{m}{2}, b - \frac{m}{2} \right) \text{ and } \left( \frac{m}{2} + \sqrt{2ab} - b, \frac{m}{2} + \sqrt{2ab} - a \right)
   \]

The final answer is \( \boxed{ \left( \sqrt{a} - \sqrt{b} \right)^2 } \) for the distance between the centers and the line segment connecting \(\left( a - \frac{m}{2}, b - \frac{m}{2} \right)\) and \(\left( \frac{m}{2} + \sqrt{2ab} - b, \frac{m}{2} + \sqrt{2ab} - a \right)\) for the locus.