LTCG on shares for deduction in second residential house

Shailesh (Manager) (37 Points)

25 October 2021  
Mr A and B jointly own one residential house. Now they jointly buy second residential house in the names of Mr B and A in FY 2021-22.

For the purchase of second residential house, Mr A and B sold shares and long term capital gain is earned. Is deduction for LTCG available? for both and under which section?
Thanks in advance!