He was helping his dad, as a lot of young boys like to do.  In any case, I don't believe he was actually operating the nail gun but was instead holding or steadying something as his father fired the gun.