State tax filing

Why do gain/loss from stock sales count towards Question 1 but not Question 2?  That discrepancy doesn't make sense to me.