Both are correct, but for different contexts.
"When I was three..." = I had reached the age of three, so I did something
"As I was three..." = Because I had reached the age of three, I was able to do something. Before that I was not able to do it.
Student or Learner