In addition to the shaking after the recitation of the berakha on the lulav, the Sages ordained holding the lulav during the recitation of Hallel and shaking it when reciting the verses of “Hodu la-Shem ki tov ki le-olam ḥasdo” (“Thank the Lord for He is good, for His kindness endures forever”) and “Ana Hashem hoshi’a na” (“Lord, please, save us”) (Sukka 37b). They linked their enactment to a verse: “Then shall all the trees of the forest shout for joy…. Thank the Lord for He is good, for His kindness endures forever. Declare: Save us (hoshi’enu), O God, our deliverer, and gather us and save us from the nations, to acclaim Your holy name, to glory in Your praise” (1 Divrei Hayamim 16:33-35). How can trees “shout for joy”? When they sway and rustle. And when is that? When they recite “hodu” and “hoshi’enu.” The end of this verse may allude to an additional function of shaking the lulav – it may serve as a prayer for the ingathering of the exiles from the four corners of the earth.
Since Sukkot is when we are judged concerning rain, shaking the four species – which grew from the rains of the previous year – expresses thanks for the blessings of the previous year and a prayer for the upcoming one: that from the heaven, the earth, and the four winds will come beneficial rain and dew, not harmful precipitation and destructive winds.
As we have learned, we shake the lulav when we recite the verses “Hodu la-Shem ki tov ki le-olam ḥasdo” and “Ana Hashem hoshi’a na” in Hallel. The shaking is parsed according to the words, and when saying God’s name, one stops and concentrates on the holiness of His name. Thus, when reciting “Hodu,” which contains six words apart from the name of God, one shakes in one direction with each word. When reciting “Ana,” which has only three words apart from the name of God, one shakes in two directions with each word (MB 651:37).
According to the kabbalists, we shake the lulav five times: 1) After reciting the berakha on the lulav; 2) at the first instance of “Hodu”; 3-4) at the two instances of “Ana Hashem hoshi’a na”; 5) during the recitation of “Hodu” at the end of Hallel. There is no difference between the ḥazan and the congregation in this respect. Sephardim and some Ḥasidim follow this practice. Yemenites shake the lulav only four times, as they recite “Ana Hashem hoshi’a na” only once.
According to Ashkenazic custom, the congregation shakes the lulav nine times, and the ḥazan seven, because according to this practice, the custom is to shake the lulav every time the verse of “Hodu” is recited. When the ḥazan recites “Hodu” and the next three verses (“Yomar Na,” “Yomru Na Beit Aharon,” and “Yomru Na Yir’ei Hashem”), the congregation responds with “Hodu.” The ḥazan shakes the lulav only to accompany the first two verses, “Hodu” and “Yomar Na”: the first because he is praising God, and the second because he is calling on all of Israel to praise God, and he is part of their subsequent praise. In contrast, the last two verses are not all-inclusive but are limited to the house of Aharon and God-fearers; he is not included among them, so he does not shake the lulav then (SA and Rema 651:8). The ninth shake (the ḥazan’s seventh) is at the end of Hallel, when Ashkenazim recite the verse of “Hodu” twice and shake the lulav each time, whereas, as we said in the previous paragraph, the kabbalistic practice is to shake only once then.