For a personal residence changing lead pipes would not be deductible.
However, if the change increases
your home’s market value and/or extend its useful life, you can add to the cost basis of your home, which may reduce
the capital gain when you sell your property.
In addition, you may be able to
deduct the sales tax paid for building materials for a major improvement to the
home if you itemize deductions and choose the sales tax deduction over state
income taxes paid.
See Home Improvements And Your Taxes