All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
As for dividing your property among the heirs and making them its owners while you are still alive in a way that they dispose of it as its real owners, then this is permissible but making a will for an heir is not permissible unless all other heirs agree to it while they are all adult and have sound reasoning.
Therefore, it is not permissible for you to make a will to your children unless you fear that their right in the inheritance will be lost, in which case, you may write a will for them according to their legal shares. For more benefit on how to write a will, please refer to Fatwa 85438.
As regards the fostering of the children, then if their father is dissolute, he has no right in fostering them; rather, the fostering will be transferred to the females who have more right in fostering them. In case of dispute about the fostering, the case should be taken to an Islamic court or to an institution that acts on its behalf, like the Islamic Centers; for more benefit, please refer to Fatwa 87762.
Therefore, there is no benefit in making a will about the fostering of your children because after your death the fostering will be for whoever legally deserves it, and this is something that we are unable to know and determine now, but if you really fear about your children to be harmed after your death because of what you mentioned, then we advise you to ask the Islamic Center in your area to take care of them after your death.
Also, if you fear the fostering will be given to someone who is not eligible for it, then it is permissible for you to write a will for a Muslim family to take care of them.
Allaah Knows best.