Praise be to Allah, The Lord (The One and Only) of the Worlds, and blessings and peace be upon our Master Muhammad, the Truthful and the Faithful.
The first type of close people who are entitled to your good deeds is your relatives, so your poor brother is the first priority when it comes to giving others from your bestowal, as he is your brother. Likewise, your sick nephew who needs to go under an operation has the priority to help him financially.
The second type of close people includes neighbors who have many rights upon you. One of the neighbor's rights upon you is to share your precious food with them if they see you carrying it, or they smell your barbecue. Doing this is a kind of Ihsan (benevolence).
The third type of close people includes those who are close to you in Iman (faith, belief and religious commitment). To elaborate, if you have a relative, who sometimes drinks intoxicants, who does not pray, and who is overwhelmed with sins, while the other relative is a committed believer, then the believer has the priority to be helped financially. However, you can give money to the religiously uncommitted relative to buy food for his children only.
So, the rule is that the close people who have the right to get your Ma'ruf (good deeds) first are the relatives, the neighbors, and the believers.