Home Depot can print old receipts as long as you have the transaction information off your old receipt or you have the credit card number or debit card number you've purchased the item or items with.
The Home Depot can enter your credit card information and look up the transaction and find your receipt that way as well.
But if you used cash to purchase the item from Home Depot then you need the transaction information of your old receipt.
If you do not have that you are usually out of luck and Home Depot will usually not be able to print the old receipts.
Always keep your purchase receipts in a good easy to find location such as in a desk drawer or or in a filing cabinet in a folder marked receipts in case you need the receipt to return something.