Rule 1: 1. The cases in context
Watch the endings as the same noun moves through a sentence. خَالِي my uncle is the subject; بَيْتُ خَالِي my uncle's house puts it second in an iḍāfa; زُرْتُ خَالِي I visited my uncle makes it the object, though with the suffix ـِي the vowel is hidden. With other nouns the vowel is visible: اَلْجَدُّ, بَيْتُ الْجَدِّ, زَارَ الْجَدَّ.
اَلْجَدُّ فِي الْبَيْتِ.
al-jaddu fi-l-bayti
The grandfather is in the house.
بَيْتُ الْجَدِّ قَرِيبٌ.
baytu-l-jaddi qarībun
The grandfather's house is near.
زَارَ خَالِي الْجَدَّ الْيَوْمَ.
zāra khāli-l-jadda-l-yawma
My uncle visited the grandfather today.
أَكَلَ عَمِّي لَحْمًا فِي بَيْتِ الْجَدَّةِ.
akala ʿammī laḥman fī bayti-l-jaddati
My uncle ate meat in the grandmother's house.