Deductions & credits

If this form is completed showing the gain related to RI; should the gain be excluded from Massachusetts income tax? Or will a credit be calculated based on taxes paid to other states?