Rotation of the cube on the corner

Please small sample… how to rotation of the cube on the corner… something like youtube[.]com/watch?v=r3D7pIJY2VA

Thanks.