Questions & Answers about Собака выглядывает из дома.
In Russian, the preposition из (out of, from inside) always takes the genitive case.
The noun дом (house) in the genitive singular is дома.
Declension of дом (singular):
- Nominative: дом (the house) – subject form
- Genitive: дома (of the house / from the house)
- Dative: дому
- Accusative: дом
- Instrumental: домом
- Prepositional: о доме
Because из requires the genitive, you must say из дома, not из дом.
The choice of preposition depends on the spatial idea:
из
- genitive = from inside something, out of an enclosed space
- из дома – out of the house (from the inside)
- из коробки – out of the box
от
- genitive = (away) from a person / object / source, not necessarily from the inside
- уйти от дома – go away from the house (distance increases)
- письмо от друга – a letter from a friend
с(о)
- genitive = from the surface / from on top of something
- с стола / со стола – off the table
- с крыши – from the roof
In Собака выглядывает из дома, the dog is looking out from inside the house, so из is the natural choice.