He passed away a few days before his hundredth birthday.

Literal

Hundredth birthday [possessive-の] several-days before [to-に] passed-away.

百歳の誕生日の数日前 is a precise time expression. なくなった (亡くなった) is the euphemistic way to say 'died' — more respectful than 死んだ. A poignant near-miss.