فَرِحَ أَخُو حَامِدٍ — Hamid's brother became happy.
● فَرِحَ is the verb.
● The complete phrase أَخُو حَامِدٍ is the subject.
● أَخُو is the head of the subject phrase and is therefore nominative.
● حَامِدٍ completes the possessive meaning: whose brother?
Do not call only حَامِدٍ the subject; the whole phrase names the doer.