Praise be to Allah.
In sharee’ah, a person is considered to be dead and therefore subject to all the rulings concerning the deceased, when either of the two following signs are noted:
When his heartbeat and breathing stop completely, and the doctors decide that they cannot be restarted.
When all the functions of his brain stop completely, and experienced doctors and specialists state that this is irreversible, and his brain has started to disintegrate.
In these circumstances, it is permissible to turn off life support systems, even if some parts of his body – such as the heart, for example – are still functioning artificially with the help of these machines.