A man who attacked a house with a crossbow and a hatchet while a mother and her children were inside has been jailed for five months.