Both. Gain on the sale of real property is generally taxed in the state the property is located. Further, your resident state will generally tax all of your income, but will allow a credit for the tax paid to the other state. The credit is generally limited to your resident state tax rate. Say, for example, your resident state tax rate is 5 percent, but you paid 6 percent in the state where the property was located. Your resident state would allow a credit at the 5 percent rate, not 6.
You need to file two returns and you need to do it in a specific order to get the computer to calculate it correctly.
First, delete all the state returns that you have created so far. You have to start over.
Then, you're going to create a state return for SC. You will tell it you are a non-resident. Go through all of the steps and tell the program that you sold the property in South Carolina but all of the rest of your income is not South Carolina income. South Carolina will tax you on the property sale and you'll owe them some money.
Last, you'll create your resident return for North Carolina. You will enter everything in and the system will enter in a credit for taxes paid to other states. North Carolina will also tax the home sale. But it will deduct the taxes paid to South Carolina so that you don't pay the same taxes twice.