"I did not drink coffee when I was a child."
Translation:Eu nu am băut cafea atunci când am fost copil.
why I couldn't write: "...atunci cand am fost UN copil? It said' it's wrong hm.
It's not wrong. It might be slightly more unusual to include the indefinite article here, but there's nothing wrong with it.