Question: “It is possible to recite birkat halevana from indoors if one can see the moon through a window (open or closed) or is it necessary to be outdoors? Are there any dispensations if one is ill..?”
Answer: The Rema in OC 426:4 writes that Kiddush Levana should not be recited under a roof. The Mishna Berura there explains that it is comparable to greeting a king, and one would be expected to go out to the street to do so. However, the Mishna Berura continues that this is merely preferable; if someone is incapable of exiting their house they may recite it inside. In the Shaar HaTziun he adds that while ideally the window should be opened, if this is not feasible it is not necessary.