Question: We’ve been invited by some friends to Friday night dinner. Where should we light our Shabbos candles?
Answer: The Shulchan Aruch (OC 263:9) writes that one who lights their candles inside their house but eats in the courtyard needs to ensure that their candles burn longer so that they can see them when they come back inside. Failure to do so will result in the beracha being a beracha levatala. The Mishna Berura (263:40) writes that while it is ideal for the candles to burn into the night, it is sufficient even if they burn during his meal when one eats before nacht (See Baer Heitev 263:14).
The Shulchan Aruch (OC 263:6) writes that students who learn away from home should ideally light their Shabbos candles in their bedrooms. Thus, the Mishna Berura (263:46) writes that while the hosts should light on the Shabbos table, guests should ideally light in their own room even if they aren’t eating there at all.
Following this, R’ Ephraim Greenblatt (Rivevos Ephraim 1:183) writes that one eating out though sleeping at home should ideally light at their own house. It is ideal if they can leave the candles burning until they come home, though if necessary they can stay with them for a few minutes before they go out (See Minchas Yitzchak 10:20).
Likewise, R’ Yehoshua Neuwirth (Shemiras Shabbos Kehilchasa 45:8) writes that while children who visit their parents for Friday night dinner often light together with their parents, they should ideally light in their own houses.
If lighting at one’s house isn’t an option, then one can light in their host’s house. Even though their host has lit candles one can still light with a beracha as they are adding to the light (Mishna Berura 263:35).In conclusion, it is preferable to light where one sleeps on Friday night, rather than where one eats.