The Sages instituted bowing in five places in the Amida: at the beginning and end of Avot, at the beginning and end of Modim, and at the end of the Amida, when one takes three steps backwards. They specifically chose those two berakhot because they are the most important, and while reciting them one must try harder to concentrate properly (see SA 101:1; MB 3). If one wants to bow at the beginning or end of another berakha, she is taught not to, so as not to undermine what the Sages instituted and so that she does not appear as an arrogant person who considers herself more righteous than others. However, one may bow in the middle of one of the berakhot (SA 113:1; MB 2, see Peninei Halakha: Prayer, ch. 17 n. 3).
One bows when saying “Barukh Ata” and straightens when saying “Hashem.” For Modim, she bows when saying “Modim anaĥnu lakh” and straightens when saying “Hashem” (SA 113:7; MB 12; for the laws on bowing down at the end of the Amida, see below, section 11).
One must bow so low that the vertebrae in one’s spine protrude from her back. One bends her head low so that it is below the level of her heart and above waist-level, but no lower, as it would appear arrogant. One should bow quickly, demonstrating her desire to bow before God, and straighten herself slowly, like one who wants to keep bowing before God (SA 113:6). An elderly or ill person who has difficulty bending down should nod her head as much as she can (SA 113:5).
Regarding how one bows, there are two customs. According to the Ashkenazic custom, when one says “barukh” she bends her knees and when she says “Ata” she bows until her vertebrae protrude. At Modim, the word “Barukh” is not recited, so one bows without first bending her knees (MB 113:12; and see Kitzur SA 18:1). The Sephardim practice according to Arizal’s custom and bow down in two stages. First, one bends her body (without bending her knees) and then her head. Similarly, when she straightens herself, she first straightens her body and then her head (Kaf Ha-ĥayim 113:21).