screen won't rotate when I turn the phone horizontally.
If you're referring to the S6 Edge, that seems to be a recurring issue. Have you contacted Customer Service or Samsung?
S6 Edge Screen Rotation
It is a hardware issue and you can either send the phone to Samsung for repair or get an exchange if it's new. The problem is the gyroscope or assembly problem, as per Samsung repair branch.