Okay, so like I said in comments, the easiest solution is to instance a cube with 6 windows. And if you want a single window, you're going to have problems at the corners.
But, I think part of the point to this, for you, is gaining a better understanding of how to handle problems in geonodes, so I treated this as a more abstract problem than that. The problem is, how to align point rotation orthogonal to a grid?
It's a little bit complicated when you just look at the nodes. That's because there are quite a few repeated elements. When you organize it mentally into separate processes, it ought to make more sense. But without further ado....
So the first question is, how do we divide our points into four groups by facing? We're going to be doing that by looking at the dot product of their position with arbitrary vectors (the +X vector and the +Y vector). That will let us know which quadrant they belong in. After we assign quadrants, we can separate these points into four groups and rotate each group with a different rotation.
That's the basic plan. Let's talk about some of the nitty gritty.
The first thing I do is to create a rescaled copy of my position. That's because if verticesX and verticesY disagree, the angles defining my quadrants won't actually be at 45 degrees. By scaling my grid back into a square, no matter what its original dimensions, the quadrants will be properly represented at 45 degree angles. I store this temporary position in an implicit attribute I named "squaredPos".
After that, I do a bit of separation and combination to eliminate the Z component of squaredPos. This is because I anticipate you're going to want multiple stories. The angle we're interested isn't actually the angle from the origin-- it's that angle, projected onto a Z plane. So by eliminating the Z component, that's what I'll get.
Then, we have to normalize this vector so that we can compare it to our arbitrary vectors. The dot product of two unit-length vectors is the cosine of the angle between those two vectors. These angles define our quadrants. The cosine of 45 degrees is 0.707-- the square root of 2, divided by 2-- which is why we're testing for those values. (The cosine of 225 is -2^0.5/2.)
We assign our points into four different groups based on the values of our two dot products, then we use these groups to separate our points into four different sets of points that we can rotate. Finally, we rejoin all of these points and instance our geometry.
Note what I was saying: the corners aren't right. These corners are places where the dot product was exactly 0.7 or -0.7-- they fit into two different categories. If we really wanted, we could actually create four more groups-- points that fit into multiple facings-- and rotate and instance new, different geometry based on these groups. That would make this tangle of nodes even harder to understand though, and I think if you understand the processes of what I've described so far, you should be able to reason your way there.