The Verdict: Need More Info
You can apply to be registered as a Kenyan citizen once seven years have passed since your marriage, provided you do not remarry someone who is not Kenyan before then. Kenya treats you as lawfully present in the meantime.
The law counts the rest of the seven years as though the marriage had continued. The other conditions are the same as for a living spouse: the marriage was recognised in Kenya and genuine, and you have no prison sentence of three years or more. You use the immigration service’s widows and widowers form, on the eFNS portal.