First make sure you’re logged in to YouTube with your account. If you don’t have a YouTube account, just login with your Google account (Gmail etc.), that should work too. Then click on your username in the upper right corner of YouTube and select “Account”, like this:
Now you find “Playback Setup” in the menu and you tick both “Always choose the best option for me based on my player size” and “Always play HD when switching to fullscreen (when available)”. Remember to save changes.