It was never said, it was probably just complete luck
However, we do know that he was singleminded and absolutely determined, brilliant and creative, and probably more than a little crazy to start with, so he probably tried things that nobody would have thought of, or would have dared to try.
Anyway, whatever he did drove him completely around the bend, so he probably couldn't have explained it to anyone else, even if he hadn't died not long after.
Caan was using an emergency temporal shift which is just random teleportation. The Time lock can't be broken intentionally but you could randomly go through it.
So far as we have been told, Caan didn't break the time lock, in the sense that Rassilon tried and failed to break it. According to Davros (not necessarily a trustworthy witness), the emergency temporal shift took him into the Time War. Davros didn't say how it did this. Probably, as said above, it was sheer chance. Caan's rescue of Davros seems intentional but Caan may just have been capitalising on the initial fluke. Perhaps his entry into the war left some kind of path that he, and only he, could use to get back out of it again and he took Davros with him.
When the Doctor was asked how he had survived the war, he replied: "By accident." The two incidents suggest that the time lock has multiple loopholes but that they are virtually impossible to find deliberately.
Rassilon's attempt was quite different and, except for the Doctor's intervention, it looks as if it would have succeeded. It was basically a variant of the technique used to pass a towing cable between two ships: First, you fire a rocket with a light line attached. Next, you use the line to pull across the cable. Finally, you use the cable to tow the ship. The light line was the rhythm of four beats. The cable was the diamond. The ship was Gallifrey. According to the Doctor, if Gallifrey had been brought through, that would have broken the time lock completely and everything else from the Time War would have been set loose. Neither the rhythm of four nor the diamond was enough actually to break the lock.