You'll need a little math for that.
so first you'll get the difference of the 2d vectors of the objects (x and y for example)
then, you need to get the arc tangent of the value you got previously
it would look something like this:
var a = Vector2(200, 600)
var b = Vector2(300, 100)
func getangle():
var diff = Vector2(a.x - b.x,a.y - b.y) #or can just be a - b but can be bothered to check
return atan(diff.y,diff.x) #return angle in radians. use radtodeg() if you want the angle in degrees.
the vectors used will be the axis that isnt the axis of rotation. example:
getting y rotation using x and z vectors from both objects.
after that, set the bodies rotation.someaxis to getangle!