Try Options | Preferences | Metadata | Rotate Based on XMP/EXIF Data (there's a also a sub-option to exclude Portrait oriented images).
For raw files, see Options | Digicam | General | Rotate.. and/or Options | DCRaw | Rotate Automatically (depending on which plug-in you use for raw files)
Note that a change of these settings only affects future thumbnails, not the existing ones. To see if a changed option works as expected, select an existing thumbnail and press F3 to re-make it.