Enabling Pins on the Adafruit Motor Shield V2
Adafruit is very good at supporting their creations, including the shields. Look for the schematic for the shield on the product page. It will show which pins are in use. You can then use any other pin.

Those second rows right by the headers are connected (check with a multimeter to be sure), and using them as alternatives are what they are there for.