If you draw a lines connecting at least two points on the tilted square with the corresponding points on the upright square, then find the perpendicular bisectors of those two lines, then the point that those perpendicular bisectors cross will be in the exact same place in both shapes, and can therefore be used as the centre of rotation of one square to the position and orientation of the other.
There are two obvious ways to do this in the figure so I would regard these as the two easier solutions to find; since the connecting lines are horizontal and vertical, the perpendicular bisectors will be vertical and horizontal.
The lower point has coordinates (1, sqrt(3)), and the upper point has coordinates (-1,2+sqrt(3)).
The other two points can be found using the same method, but now the perpendicular bisectors are not conveniently parallel to the axes, and so the maths is not so straightforward. Nevertheless, the coordinates of the points can be determined to be: (2*sqrt(3)/3-1,sqrt(3)/3+2) and (2*sqrt(3)-3,4-sqrt(3)).
Numerically, to three decimal places, the four points are, from top to bottom: (-1,3.732), (0.155,2.577), (0.464,2.268) and (1,1.732).
Of course, there’s no particular need for the two corresponding points that you choose to connect, to be corners of the square. If instead you chose the exact centre of the two squares, and construct the perpendicular bisector as before, the rotation point will also lie on this line, and since the four different rotation options will all have the same position as the centre of the square, that explains why the four points are collinear.