Hi @iCo0o01bg
please use code tags for your code: Using code tags properly
There are many examples and little bit different ways to do this, for example if you google “unity limit camera rotation” you’ll find links like this: Limit vertical rotation of Camera - Questions & Answers - Unity Discussions
I didn’t check your code properly, but you should first get the input from player / mouse / whatever drives the rotation, then clamp it to min and max values in your axes. Then apply these values to your camera rotation. Using Euler angles to do this is probably a good idea, if you want to mimic real camera work. YouTube has many tutorials on this topic.