I would like to add that this word is formed through the transformation of a noun into an adverb. Some other adverbs created like that are as follows: зимой, летом (Instrumental case form); внизу, наверху (a preposition turning into a prefix).
Ужинать дома - why in genitive?
2 Answers By Expert Tutors

Lyudmila G. answered 03/19/19
Russian Language and European Knitting for Beginners Tutor
In this sentence "дома" is an adverb, it answers the question "where?" (Context rules)
Возможны два варианта: существительное дóма (р. п.) и наречие дóма.
Существительное дóма (в родительном падеже) отвечает на вопрос «чего?»: у меня нет дома. Наречие дóма отвечает на вопрос «где?»: меня нет дома.
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.