Both. But IN will give you a credit, or partial credit for the tax paid to OH.
If it was a rental, the gain will probably qualify for Ohio's Business Income Deduction and you will not pay any tax to OH, but will still have to pay IN, since you received the income while a resident.