Let (x1 , y1 , z1 ) be the center of mass of object-1 and (x2 , y2 , z2 ) be the centre of mass of object-2.
Let these coordinates are assigned with respect to some coordinate sytem and originf
centere of mass of combined system of object-1 and object 2 with respect to the origin of the considered coordinate system is given as
X = ( m1 x1 + m2 x2 ) / ( m1 + m2 )
Y = ( m1 y1 + m2 y2 ) / ( m1 + m2 )
Z = ( m1 z1 + m2 z2 ) / ( m1 + m2 )
Now let us choose the coordinate system so that one of the axis, say x-axis, lying on the line connecting centre of masses of object-1 and object-2 .
Then transformed coordinates of centre of mass of combined system are given as
X' = ( m1 x1' + m2 x2' ) / ( m1 + m2 )
Y' = 0
Z' = 0
y and z coordinates of transformed coordinate system is zero , because both of center of masses of object-1 and object-2 are at x-axis.
Hence it is proved that center of mass of combined system two objects lie in the line connecting the centre of mass of individual objects.