The first word you're thinking of ("before starting to eat") is [頂きます]{itadakimasu}. This is the polite form (ending in -masu) of the plain verb [頂く]{itadaku}.
<joke>
In turn, itadaku is a compound of [板]{ita} ("board, plank") and [抱く]{daku} ("to hold in one's arms, to hug"), with a compound meaning of "to hug a board". </joke>
More seriously, itadaku is a humble word meaning "to receive". It is used in many contexts, such as:
- At the start of a meal, used idiomatically to mean "I humbly receive this food", vaguely similar to how some people say grace before eating.
- In a literal sense, to indicate that you have received something from someone else.
- After another verb in the -te or conjunctive form, indicating that someone else is doing that verb for you.
The second term you're thinking of ("when ... leaving the house") is [行って]{itte}[来ます]{kimasu}. This is two verbs: itte is the -te or conjunctive form of the verb iku (polite form ikimasu, "to go") and kimasu is the polite form of the verb kuru ("to come"). Itte kimasu literally means "I'm going and coming back." Folks use it not just when leaving the house, but also when leaving some other place and coming back soon, for example, when leaving one's job site for a little bit to go to lunch or run an errand.