Praise be to Allah.
Giving zakaah al-fitr is obligatory for every Muslim who has food surplus to his needs for the day and night of Eid: one saa‘ of his staple food and that of his dependents and his basic needs. That is because of the hadith of Ibn ‘Umar (may Allah be pleased with him), who said: The Messenger of Allah (blessings and peace of Allah be upon him) enjoined zakaat al-fitr upon the people, a saa’ of dates or a saa‘ of barley, upon each of the Muslims, slave or free, male or female, young or old, and he enjoined that it be given before the people went out for the prayer. Narrated by al-Bukhaari (1503) and Muslim (984).
What he needs of staple food for himself and his dependents takes precedence over giving zakat al-fitr because that is more important, so it must be given precedence, as the Prophet (blessings and peace of Allah be upon him) said: “Start with yourself and give charity to yourself. If there is anything left over, then (give) to your family. If there is anything left over from your family, then (give) to your relatives. If there is anything left over from your relatives, then like this and like this,” meaning in front of you and to your right and to your left. Narrated by Muslim (997).
The individual is required to give zakaat al-fitr on behalf of himself and of those on whom he spends, such as his wife, his children and his relatives, if he is obliged to spend on them. But if what he has is not sufficient to give zakaat al-fitr on behalf of all of them, he should give it on behalf of some of them, starting with the closest then the next closest. So he should start with himself, then his wife, then his mother, then his father, then his children, then his relatives such as his brother.
It says in Zaad al-Mustaqni‘ (p. 77): If he is unable to give it on behalf of some of them, then he should start with himself, then his wife, then his slave, then his mother, then his father, then his children, then the next closest in terms of inheritance. End quote.
It says in Kashshaaf al-Qinaa‘ (2/249): The order of people on whose behalf you give zakaat al-fitr is the same as the order in which you spend on their maintenance, because they are connected. So if he cannot afford to give it on behalf of the whole group of those on whom he spends, then he must start with himself, because we have established above that it is connected to maintenance, and spending on his own maintenance takes precedence. Thus he must give his own fitrah first, then give on behalf of his wife, even if she is a concubine, because he is obliged to spend on her in all cases, unlike other relatives. Thus she is given precedence over others, because she is of greater importance in this regard, and because her maintenance is in return for intimacy. Then he must give on behalf of his slave, because he is obliged to spend on him even if he is going through financial hardship. Ibn ‘Aqeel said: The slave may be given precedence over the wife, for fear that he may forget him altogether. Then he must give on behalf of his mother, because she takes precedence over the father with regard to showing kindness, because of the hadith. Then he should give on behalf of his father, because of the hadith, “You and your wealth belong to your father.” Then he must give on behalf of his child, because it is, generally speaking, obligatory to spend on him. Then he should give on behalf of on others in order of who would inherit from him, the closest then the next closest. That is because the closest is more deserving than others, so should be given precedence, as in the case of inheritance.
If there are two or more of equal standing, such as two children or more, or brothers, and there is nothing left except one saa‘ [to be given as fitrah], then he should draw lots, because they are of equal standing and there is no reason to give precedence to one over another, so there is no option left except to draw lots. End quote.
And Allah knows best.