From the Super Mario Wiki
Luiginary Hammer is the third available Dream World Luiginary Attack in Mario & Luigi: Dream Team. The Attack Pieces for it can be found in Dreamy Mount Pajamaja and it costs 10 BP to use. Before this attack begins, Dreamy Luigi poses on top of Mario as if he's holding a hammer.
When the attack begins, Mario will back up, spawn Luiginoids out of Dreamy Luigi (who poses like he's holding a hammer), and hold his hammer above him. The player has to keep pressing the button to make the Luiginoids jump on to Mario's hammer while the player moves the to the left and right to move Mario in order to keep him and the hammer balanced while trying to stay in between the two white boundaries.
After all Luiginoids are picked up or after a certain period of time if the sequence was successful enough, Mario will advance towards the enemies with his Luiginary Hammer, and a crosshair will appear in front of him, indicating which enemies are in the main target range. The player can move northwards and southwards with the while Mario is advancing to move the target range, and must press the button to unleash the attack on the target area, a shockwave damaging surrounding enemies. The more Luiginoids collected, the more damage dealt and the better rating the player will receive ranging from "OK!" to "Excellent!" ratings.
Press the B Button repeatedly to form the Luiginoids into a giant hammer! It will tilt, so use left/right on the Circle Pad to help Mario keep it balanced. As Mario runs, aim with up/down on the Circle Pad and swing with the A Button.
Names in other languages