⇧⌥⌘ → (Shift + Option + Command + Right) to expand all the task groups.
⇧⌥⌘ ← (Shift + Option + Command + Left) to collapse all the task groups.
Alternatively, put five fingers on the touchpad (do not need to click, just put the fingers on the pad simultaneously).