[EDIT2]
Following the help I got in the comments + answers I found
$$\begin{align} a &\leq \sqrt{H^2-b^2} \\[4pt] a &\leq \sqrt{h^2-b^2} \end{align}$$
as the answer with this process https://i.stack.imgur.com/Z6mwd.jpg
I need to develop a method to know if the box can pass or not
]
I need to find a method to know if I can turn my box to keep moving in the hallways, when I give $a$, $b$, $h$ and $H$ (in meter) can show if it will pass or not.
For example $a=3, b=1.5, h=2.1, H=2.1$
I'm really stuck with that and I though that someone here could help me (if you want to do it with voice call or anything I can give you my Discord in private)
I tried to draw a isosceles triangle with the side a of my box to calculate his height of the triangle but I'm stuck with the $h$ and $H$

The problem can be solved if you think what is the condition that the box is just stuck. That means that the box cannot be translated or rotated. Say you have the pivot point $P$ next to the $90^\circ$ label. Your upper corner of the box is just touching the top side of hallway with the width $h$. Then you cannot translate any longer in the upper direction. Similarly, the left most corner will touch the left wall of hallway $H$. The condition of just barely being able to rotate is that the top corner is right above $P$, and the left corner is exactly left of $P$. You now get two right angle triangles. Using Pythagoras' theorem you can calculate the length from $p$ to the right most corner and to the bottom corner. You can then rotate/move the box if the sum is less than $a$. $$\sqrt{H^2-b^2}+\sqrt{h^2-b^2}\le a$$