Under Section 2 (14) agricultural land is not a capital asset if it is not situated—
(a) in any area which is comprised within the jurisdiction of a municipality (whether known as a municipality, municipal corporation, notified area committee, town area committee, town committee, or by any other name) or a cantonment board and which has a population of not less than ten thousand according to the last preceding census of which the relevant figures have been published before the first day of the previous year ; or
(b) in any area within such distance, not being more than eight kilometres, from the local limits of any municipality or cantonment board referred to in item (a), as the Central Government may, having regard to the extent of, and scope for, urbanisation of that area and other relevant considerations, specify in this behalf by notification in the Official Gazette
If the land sold is not capital asset there is no question of tax on capital gain.
On the other hand if the land sold is a capital asset then you can claime exemption u/s 54F by acquiring residential property.