...on the capital gain which was carried out during the first transfer of a dwelling other than the main residence?
Yes. When a person sells real estate which is not their main residence, it is possible to request exemption from the capital gain that has been realized, subject to meeting the required conditions (art. 150 U, II, 1° bis Tax Code). Although the text mentions the first transfer of a dwelling, the exemption is applicable if the transferor has never benefited from this exemption, either because the property previously sold did not meet the conditions for the exemption, or because the assignor did not request it (BOi-RFPI-PVI-10-40-30 §150).