You can limit values with the expressions min, max and clamp. And you can use those when setting the camera positions, for example setting the camera X to clamp(Player.X, 0, 1000) will not allow it to go below 0 or above 1000 in the X axis while following the player
You can then create "camera areas" using an invisible TiledBackground or 9Patch object, and "while player overlapping camera area" you can set the "camera area" X as the limit for the left side, and X + Width as the limits for the right side
Also you want to take into account how wide the screen is, so the camera stays in the center, so you add half the Viewport Width to that calculation
Set Camera X to clamp(Player.X, CameraArea.X + ViewportWidth / 2, CameraArea.X + CameraArea.Width - ViewportWidth / 2)
And then same for the Y axis