707. Where and When to Sanctify the Moon

97:8 The moon should be sanctified only under the sky, not under a roof. If one doesn’t have a clean space or if there is some other compelling reason (like he’s sick and shouldn’t go outside – Mishnah Brurah 426:21), he may recite the bracha in the house, looking at the moon through a window.

97:9
The best way to carry out the mitzvah is to sanctify the moon following Shabbos, while he is still wearing his nicest clothes. However, if Saturday night is more than ten days from the first appearance of the moon (molad), or if there is concern that one won’t be able to sanctify the moon, one should not wait until Saturday night. It’s a mizvah to sanctify the moon in a group because “the King’s glory is in a multitude of people” (Proverbs 14:28). One should not, however, delay because of this since performing mitzvos with alacrity it more important than performing them in a group.