Start with your general motion equation - you will solve it in both x and y:
d = d0 + v0 t + (1/2) a t^2; d is the displacement, v is the velocity, a is the acceleration, t is the time, and subscript 0 indicates at time t = 0.
Because he kicked the rock off the top of the building, assume that it started out traveling horizontally only. So v0y = 0 and v0x = v0
Take the origin to be at the point the rock left the building; x0 = y0 = 0
This is a free-fall problem, so ax = 0 and ay = a = g = 9.8 m/s downward
y = 18 m (given) and x = 14 m (given)
I am defining positive as the toward the other building (direction of initial motion) and down.
Motion problems (any vector problems) are always solved separately in x and y. The reduced equations are: x = v0 t and y = (1/2) g t^2 The x equation has the velocity needed, but depends on time; so the y equation must be solved to get time.
==> t = sqrt[ (2 y) / g] = sqrt[ 2(18m) / (9.8 m/s^2) ] = 3.67 s (3.7 s)
Solve x equation for v0: ==> v0 = x/t = (14m) / (3.67 s) = 3.8 m/s