How can the landing gear fit in the small room in the engine bay on the Tupolev Tu-144?
The Tu-144 uses much smaller wheels than comparably-sized subsonic aircraft. This makes it possible to rotate the gear bogie sideways towards the middle of the aircraft, so it can be stowed vertically inside the wheel well. Your picture already hints at that:  Note that the gear strut is offset inside the wheel well, so it would leave more space on one side for the gear bogie.



Tupolev Tu-144 landing gear (picture source). Note the big drums of the wheel brakes: They were needed to stop the aircraft - the engines had no thrust reversers! Inside are stacks of disc brakes to absorb the energy that comes with a landing speed of 270 km/h. Also note the unusual sideways arrangement of the scissors link: This way it did not interfere with the rotated wheel bogie. Next clue: The big hydraulic cylinder on the left was used to pivot the bogie around an axis parallel to the direction of flight. 



Picture of a photo from Tu-144 landing gear test, including finger print (picture source). This shows the gear in mid-sequence: The bogie is already rotated and lies sideways, with the gear strut between the wheels. Now the strut pivots forward and up into the wheel well.

Requiring complex motion adds more failure modes: On its 59th flight, the XB-70A suffered a malfunction of the left gear which left the bogie in the upright position. If you want to know how it was supposed to work, watch this video from 14:47 on. The picture below is taken from this video.