That message about the "build.board" not being defined is the symptom of a botched attempt at modifying the included Arduino AVR board package. "Likely by following instructions written for a much older version of Arduino.
In and of itself that is not a problem - however, considering that you have a wacky error message implying some sort of abomination-crawling-in-from-the-depths-of-hell toolchain problem, I an suspicious that this failed attempt at modifying your build environment is the cause of that issue as well.
Uninstall all copies of the Arduino IDE.
Make a back up of C:\Users\YourUserName\AppData\Local\Arduino15, and then delete it. Reinstall the Arduino IDE, use the latest version, 1.8.13 downloaded from the Software link at the top (don't mess with the stupid windows store package; "app stores" are not a viable way to obtain software for real computers)
The sketch should now compile.