Write whereas as one word when you're contrasting two facts in one sentence. She prefers mornings, whereas I work best at night. If while or compared with keeps your meaning, it's the one.
No separate where as spelling exists. If a place clause puts where next to as, that's coincidence: the café where as a student I studied.
If you're not contrasting, check your sentence: you may need where alone or a different connector.
You're contrasting two facts in one sentence
Contrasting two facts in one sentence? Write whereas, always one word. The village gets quiet in winter, whereas the coast stays busy. This sense is listed in the Essential Mini Dictionary as the compare-different meaning, and no separate two-word spelling exists.
Not sure you're contrasting? Run the while test. If while or compared with keeps your meaning, whereas is right. Dad never checks his phone, whereas the rest of us refresh it hourly. Swap in while and the sentence still works, so the one-word form fits.
If the place word where ends up beside as in your sentence, that's two words doing separate jobs, not a spelling choice. That's the field where as kids we played until dark. Here where points to a location and as belongs to its own phrase, so they only look joined.
Mid-sentence is the usual home for this contrast, and the dictionary examples show it there. Rent is low downtown, whereas the suburbs cost more. Put the two facts on either side of it and the sentence takes care of itself.