Your code is not clear enough, but basically, you just need to get the object which need to be followed position y. Then the change the transform.position of the following game object only with y you’ve got.
The LookRotation function can only get the rotation of looking at target which you can refer to here.
To change your position you need to use this.transform.position = target.transfrom.position.