Keep in mind that it can take a newly rehomed dog some time to settle in, to adapt and adjust to all the changes they have gone through (-- your pup has been 'rehomed' at least twice in a very short period of time). Some dogs it may adjust fairly quickly, while for others it may take many months for them to trust and believe they are not going to be rehomed again.We have only had him for 3 weeks.
This graphic gives a general outline of what to expect.
I am assuming by this, that you mean when you leave him by himself in the house?So we know he can hold it if he wants. But if we leave him alone for awhile then all bets are off.
It is also not uncommon for newly rehomed dogs to experience 'abandonment'/separation difficulties, (from their perspective - it happened before, it could happen again), (I have adopted several rescues over the years) until they learn to trust, with practice and over time, that when you leave, you indeed will be returning home to them. Stress/ anxiety may be contributing to his inability to maintain house training skills, and he may need help to understand that when you leave, you will indeed be coming back. Perhaps consider practicing 'separation' and work up to actually leaving the house- (you could start with simply leaving him in another room), very briefly at first, gradually increasing the time you are gone, give him a stuffed Kong to work on, or safe chew bone - something to help keep him calm and busy. (Make a point of giving him a Kong or some other item you plan to use at other times as well, so that the item does not become associated with the fact that you are leaving him.)