In a House of Mourning
When visiting a house for nichum aveilim (comforting the mourners), we do not greet the avel (mourner) with “Shalom Aleichem” (lit. Peace to you, the traditional greeting), nor do we greet any of the other visitors. However, if it's appropriate, offers of congratulations, such as “Mazal Tov” upon hearing good news, are in order.
It's important to consider topics of conversation before the visit, to act with sensitivity and exercise proper etiquette. Someone close to the mourner may want to comfort them by saying, “What could you possibly have done differently?”But this is taboo according to halachah; such a statement is likened to giduf (blasphemy), since it suggests that human intervention could have changed the Will of Hashem. We are commanded to accept the gezeiros (decrees) of Hashem with love.
An avel is not expected to rise for any visitor; then again, we are cautioned not to tell the avel, “Don't get up,” or even, “Sit down”, so as not to chas v’shalom (G-d forbid) intimate that they should remain in mourning. A way to prevent them from rising might be to say, “Don't bother, sit peacefully.”
(For more of what to say—or not to say—to a mourner, see Halachah #155. For greetings in extended period of mourning, such as during the shloshim—the first thirty days after the passing—and the entire year following, see Halachah #407.)
Paraphrasing the customary wish in a house of mourning: May Hashem comfort all the mourners of Tzion and Yerushalayim with the coming of Moshiach, now…and these days will be transformed to times of rejoicing.