How to stop camera from showing inside the character when not blocked by them

If you block the camera then you get into this situation which is ugly and annoying for the player.

That is why I don’t want the camera to be blocked by the character, and have a way to hide the character when it is inside or too close.