You can take rebate under Section 87A from tax on long-term and short-term capital gains. However, if there is long-term capital gain from sale of equity shares or equity oriented funds (Section 112A), you cannot adjust rebate under Section 87A from tax on such LTCG.