If only one of the parts applies (that is, you only have short term gains, or you only have long term gains), you only print the part (part 1 or part 2) that applies.
The following is directly from the IRS's 2016 Instructions for Form 8949, (Page 3, Box F): https://www.irs.gov/pub/irs-pdf/i8949.pdf:
''You don't need to complete and file an entire copy of Form 8949 (Part I and Part II) if you can check a single box to describe all your transactions. In that case, complete and file either Part I or Part II and check the box that describes the transactions. Otherwise, complete a separate Part I or Part II for each category of your transactions''
Page 1 of Form 8949 is for short-term transactions, and page 2 is for long-term transactions. If you have no short-term transactions, then page 1 is inactive. Essentially each page functions as a separate form.