Inadequate sanitation contributes 4% to global mortality and 5.7% to morbidity, disproportionately among children under five. The incidence of diarrhea is disproportionately high among children in low-and middle-income countries. Somalia is one of the several countries in Africa with a high proportion of diarrhea. This study evaluated sanitation practices and associated factors in homes with children under five in Hodan District, Mogadishu, Somalia. A household-based cross-sectional study was conducted in the Hodan district of Mogadishu, Somalia, from December 2021 to February 2022. A structured pretested questionnaire with checklist household observations was used to collect data. A total of 241 caregivers who have children under five years were interviewed. Logistic regression analysis was used to find factors associated with sanitation practices and diarrhea at the home level. A confidence interval of 95% and a p-value of 0.05 were considered statistically significant. The 29% in Hodan district had poor sanitation conditions. Most of the respondents, 60.6% were in multi-family homes. Over 58.9% of households lacked access to handwashing facilities.Apartments with multiple families have 0.037 greater odds of diarrhea in children under five than single-family residences [95% CI: 0.010-0.022]. Family without toilets had a 2.257 odds ratio [95% CI: 0.2.257-23.45] of their kids having diarrhea compared to those with toilets. Children in households using pit latrines had diarrhea at 0.139 [95% CI: 0.053-0.365], and the participants who did not know the importance of water treatment had a 42.400 [95% CI: 1.777-11.213] chance of drinking contaminated water. Also, families with shared latrines were odds of 13.116 [95% CI: 06.781-25.369], more likely to have diarrhea than families who used single latrines. Similarly, family income is associated with diarrhea occurrence in children with an odds ratio of 0.363 [95% CI: 0.184-.718]. Provide water, sanitation, and hygiene (WASH) services, such as adequate latrines and water points for drinking and bathing areas with running water, particularly for children and women, including WASH supplies like soap and buckets for collecting and storing water at the housing level. We believe that the WASH educational messages also led to behavioral changes in sanitation practices among children under 35 months, caregivers, and residents in both the Zona-K internally displaced people (IDPs) area and the host community promotion is recommended.