It would be so much easier to answer this question if you had provided more detail on how these two "failed PhDs" evolved.
From what you've said, the first PhD mainly failed due to having an uncongenial topic and a bad supervisor.
The second one needs more elaboration. You seemingly approved the topic and worked hard at it (if work followed "dedication and enthusiasm" - though this is not necessarily so, of course!) but "progress" was not made. This and your saying that your second supervisor advised a new topic does not reflect badly on you: if your supervisor blamed you for the lack of progress, you would not be invited to apply for another program.
By the timeline provided by you, you have just recently stopped work on program #2. I truly understand your sense of disappointment about your energy and commitment on the last program being wasted on a dry well - that is the bane of all researchers, industry as well as academia. But I would advise against being too hasty in giving a final "No!" on pursuing PhD research as this is more likely a decision of an exhausted heart than one of a clear mind.
To answer the question of how to account for the last 2 years on a CV right now if you look for an industry job: all you can do is be wholly honest about these two programs.
First draft in longhand an honest statement to an anonymous non-judgemental friend of what you did over these years, what you were trying to do and how it panned out.
This will be emotional for you. But it's just like setting out household income and expenditure - it won't ever be as bad as you had feared and you'll learn a bit on where the money has really been going.
When you finish it read back over it. Now look at these events in the round and describe more briefly how these years were dedicated.
In the case of each program, detail the project and the results obtained in each up to the point of abandonment. It is also important to detail any training in techniques you acquired as well as literature surveys done. A lot of industry jobs in STEM are given to those up to speed in those techniques used in that company's labs and they dislike having to train people.
P.S. Is there any chance that your second supervisor would hire you temporarily as a Research Assistant as you settle your morale ? It's nice to just do experiments for a while without the anxiety and perceptual bias that goes with the responsibility of a doctoral program.