Hello. If you have the custody, you should be able to retain the flat. However, your condition is not very clear from the question. Why don't you visit this website and see what category you fit into? https://www.hdb.gov.sg/cs/infoweb/residential/living-in-an-hdb-flat/changing-owners/-occupiers/retain-flat-following-life-events. Hope this helps.