You will need to contact a third party unlocking service to purchase an unlocking code.
Also, you will only be able to use it for phone and texting.
Data/internet functions will not work.
where shall I buy the unlocking code in kenya
I have no idea since I don't live in Kenya.
Perhaps you could contact a cell phone store there and ask for a recommendation or search Google for options.