It all depends on your local circumstances....
Are your exterior walls facing in the general direction of the TV broadcasting antennas?
Are the broadcasting antennas 4 miles away or 40?
Weather?
As far as I know, there is little or no advantage to putting the antenna in a window as opposed to on a wall. It didn't matter at all in my case.
The cable connecting your antenna to your TV will likely be very sensitive to slight movements. Inches. Experiment. A given setup may have good reception for months on all channels and then need adjustment for no obvious reason...maybe due to the broadcasting antennas being fine-tuned or modified, weather, or unknown factors. Maybe your cat bumped into the cable and moved it a half inch.
It is just fussy, like "rabbit ears" antennas were 50 plus years ago.
Mine is tacked 7 feet high on a wall, a couple of feet from a window. The wall is on the west side of my residence. The broadcast antennas are about 25 miles farther west at about the same elevation. Semi "line of sight".
I do not know how critical it is to have my antenna on a wall facing the broadcast antennas. May not matter at all. Again....your local circumstances will dictate your results. It isn't highly predictable in advance. For all I know, I could tack my antenna on an east facing wall.
I never have to change that, but the cable connecting it to the TV has to be fiddled with a few times a year.
I run my antenna cable direct to my PC and watch all TV on my PC monitor via a Hauppage 1191 external TV tuner. I have not turned on my "television set" in over 5 years.
I have good luck with this, 42 bucks from Amazon 8 years ago.
Mohu MH-110583 Leaf Indoor HDTV Antenna.
It is NOT an "amplified" antenna. I have heard that those are of minimal help unless you are a very long distance from the broadcast antennas. I am about 25 miles...in a major metro area.
I get around 50 channels via the antenna.
Your mileage will differ. All you can do is buy, experiment, and hope.