It is not an Islamic rule not to leave home after delivery, rather after delivery in the state of nifas it is unlawful for a woman to have intercourse with her husband. Similarly, keeping fast, offering salah and reciting the holy Quran is forbidden, these are Islamic rulings. The matter of not leaving home is precaution according to medical viewpoint for the safety of health, for which care is taken in houses, as during nifas period often such weakness or illness occurs which takes root, which causes a woman to suffer her whole life.
Allah (Subhana Wa Ta’ala) knows Best
Darul Uloom Deoband