Within thirty days he comforts him according to his custom, and after thirty days he can say console him without mentioning the name of the deceased, and regarding mourning for his father and mother the division is between the first 12 months after the 12th month when he only says console him without mentioning the name of the dead.
Regarding mourning for his wife, the restriction is until three legs have passed or until he carries another woman, whichever comes first, and then he can tell him to console him as above, and in the event that he carries someone else, he cannot tell him to console him in his home, but only if they find him in the market, telling him to console him in soft and serious language head.
Sources: Mok 1 EB and Shu'a Yod C. Shepa Sab.
And as for the condemned man, how long after his wife's death can he marry a wife, and if he belongs to marry a wife with a permit within three legs, ref.
מק"ט התשובה הוא: 5689 והקישור הישיר של התשובה הוא: shchiche.com/5689