There are numerous ways to set up this problem. My first thought is to use the fact that the difference in their ages is 12 years to find when Andrew's age was 5 times Ciara's age. So
let x = Ciara's age when Andrew was 5 times as old
then 5x = Andrew's age then
The difference in their ages is 12 years:
It was when Ciara was 3 years old that Andrew was 5 times her age.