Nouns referring to male/female have the same gender as the referent, e.g. le (vieil) homme (line
12), la femme, le garçon, la fille, etc.
Otherwise gender is mostly arbitrary in French and has to be learnt. Some rules can help to
classify masculine and feminine nouns according to their endings.