Praise be to Allaah.
This will is not permissible, because it goes against the teachings of sharee’ah and is contrary to the justice and fairness that Allaah has enjoined, especially among one's children. Allaah says (interpretation of the meaning):
“There is a share for men and a share for women from what is left by parents and those nearest related, whether, the property be small or large — a legal share”
Then Allaah says (interpretation of the meaning);
“Allaah commands you as regards your children’s (inheritance): to the male, a portion equal to that of two females; if (there are) only daughters, two or more, their share is two-thirds of the inheritance; if only one, her share is a half. For parents, a sixth share of inheritance to each if the deceased left children; if no children, and the parents are the (only) heirs, the mother has a third; if the deceased left brothers or (sisters), the mother has a sixth. (The distribution in all cases is) after the payment of legacies he may have bequeathed or debts. You know not which of them, whether your parents or your children, are nearest to you in benefit; (these fixed shares) are ordained by Allaah. And Allaah is Ever All‑Knower, All‑Wise”
Then Allaah warns those who go against this division of legacies and play with it, by saying (interpretation of the meaning);
“And whosoever disobeys Allaah and His Messenger (Muhammad), and transgresses His limits, He will cast him into the Fire, to abide therein; and he shall have a disgraceful torment”[al-Nisaa’ 4:14]
Whoever deprives some of his children of their inheritance, or gives some of them less than is their shar’i due, or gives some more than is their shar’i due, or includes someone who is not an heir among those who are given his legacy, is a sinner who is guilty of committing a major sin. Also, it is not permissible to make a will concerning one’s heir, because he has a share which is defined by sharee’ah. Ahmad, Abu Dawood and al-Tirmidhi (may Allaah have mercy on them) narrated from Abu Umaamah (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Allaah has given everyone who is entitled his rights, so there is no will concerning the heir.” (Sunan al-Tirmidhi, 2046).
If it is proven according to sharee’ah that one of the children is a kaafir, e.g. by the fact that he does not pray, at the time of the father’s death, then he is not an heir, even if instructions to that effect are not mentioned in the will, because the Prophet (peace and blessings of Allaah be upon him) said: “The Muslim does not inherit from the kaafir and the kaafir does not inherit from the Muslim.” (Saheeh – agreed upon).
With regard to giving a gift to one of one's children and not to the others for no shar’i reason, this is haraam and is unfair, as it creates hatred in the children’s hearts towards one another. The evidence (daleel) that it is forbidden is the hadeeth narrated by al-Bukhaari and Muslim (may Allaah have mercy on them) from al-Nu’maan ibn Basheer (may Allaah be pleased with him), that his father came to the Prophet (peace and blessings of Allaah be upon him) and said: “I have given this son of mine one of my slaves.” The Prophet (peace and blessings of Allaah be upon him) said, “Have you given all your children a similar gift?” He said, “No.” He said, “Then take it back.” According to the version narrated by Muslim, he said: “Fear Allaah and treat your children fairly.” So my father took back his gift.
According to another version, he (may Allaah be pleased with him) said: “My father took me to the Messenger of Allaah (peace and blessings of Allaah be upon him) and said, ‘O Messenger of Allaah, bear witness that I have given al-Nu’maan such-and-such of my wealth.’ He said, ‘Have you given all your children something similar to what you have given to al-Nu’maan?’ He said, ‘No.’ He said, ‘Then let someone else bear witness.’ Then he said, ‘Would you not like all your children to honour you equally?’ He said, ‘Of course.’ He said, ‘Then you should not do that.’” (Muslim, 3059).
But if the gift is being given to one of the children for a shar’i reason, such as the child being poor, or in debt, or needing medical treatment, then there is nothing wrong with that. And Allaah knows best. May Allaah bless our Prophet Muhammad, and grant him peace.