Note: You do not need to do all that is above in one run to get three-stars. Once you earn the star, you keep it.
Put the TNT and Pig Besides Eachother.
Make the TNT explode by clicking/tapping it or it's button.
Mainly, the TNT must be below the Pig, as of the Picture above. Put the Pig on the left to get the lower Star Box, Right if higher Star Box.
Make the TNT explode.