Hi.
Maybe use cinemachine.
else
you could have a separate (empty)object for the camera to look at.
that object can position itself between the 2 other objects :
something like get position from obj A and B
then do A - B
Then Divide the result by 2 and add to A
(i did not test, but i think that should work)