"Dieing" vs "dying"
If someone is passing away, then they are dying. Its origins are:
late 13c., "death," verbal noun from die (v.). From mid-15c. as a pp. adj., "in the process of becoming dead."
Its confusable "dieing" means:
To cut, form, or stamp with or as if with a die.
Finally, dyeing means to stain something with color, with the origins:
c.1400, verbal noun and pp. adj. from dye.
Why is dying the gerund/verb form of to die? For one thing, it follows a general rule of forming gerunds:
The vowel group -ie is changed to -y before adding -ing.
As this page also says this, it is safe to say that this is a generally accepted rule. Other similar verbs are tie and lie. It is not a special case, but I cannot find an exact date for when this rule was created. It is worth noting that, whether or not this is correct, there are early examples of the spelling dieing for dying in the 1800s. This leads to the thought that the currently accepted form is because of a spelling reform at some point in time since then.