Entschuldigung (noun, capital E!) is used for "I'm sorry"I’m sorry and "excuse me"excuse me, but you cannot literally translate "being sorry for someone's loss"being sorry for someone’s loss and use "Entschuldigung"Entschuldigung here. It makes no sense in German. Instead, you'dyou’d use "Herzliches Beileid" (official, a bit formal)
Herzliches Beileid (official, a bit formal)
or "das tut mir leid für dich" (informal, not if someone passes away, but ok when someone fails a test.
Das tut mir leid für dich (informal, not if someone passes away, but ok when someone fails a test.)