Consider the small example:
A--1--2--3--4--5--B
Where A and B are hosts and 1,2,3,4,5 are routers and let's assume TTL value is 3.Let RouterVisit be counter initialized to 0.
So when A will send a packet router 1 will receive and decrement the TTL and RouterVisit will be incremented to 1.
Status: TTL 2 and RouterVisit 1
When router 2 will receive packet
Status: TTL 1 and RouterVisit 2
When router 3 will receive packet
Status: TTL 0 and RouterVisit 3
As TTL becomes 0 ICMP packet will be sent from router 3 to Host A.
So ICMP packet will go from router 3 to router 2(won't count router 3 again as we are currently at that router only.).
Status: TTL 0 and RouterVisit 4
From router 2 to router 1
Status: TTL 0 and RouterVisit 5
From router 1 to host A.