Answer
$S=h+(\sqrt {2gh})t$
Work Step by Step
Let's find the position-versus-time equation for both rocks: $x=x_0+v_0t+\frac{1}{2}at^2$
First rock:
We need to find the velocity of the first rock when the second rock is released:
$v^2=v_0^2+2a\Delta x$, where $v_0=0$, $a=g$ and $\Delta x=h$
$v^2=0+2gh$
$v=\sqrt {2gh}$
This is the initial velocity for the next step (when the second rock is released). So: $v_{1_0}=\sqrt {2gh}$, $x_{1_0}=h$, $a=g$
$x_1=h+(\sqrt {2gh})t+\frac{1}{2}gt^2$
Second rock:
$x_{2_0}=0$, $v_{2_0}=0$, $a=g$
$x_2=0+\frac{1}{2}gt^2=\frac{1}{2}gt^2$
The separation:
$S=x_1−x_2=h+(\sqrt {2gh})t+\frac{1}{2}gt^2−\frac{1}{2}gt^2$
$S=h+(\sqrt {2gh})t$