"He teaches history."
Translation:Han underviser i historie.
I am not a native danish speaker, but I spoke to my good friend Ingerlise who is, and taught German and Danish in school. She explained to me that this sentence really means He teaches in the subject of history. Here the subject, or faget, is implied. So you can say han uderviser godt, or han underviser barnet, but in this case you need to say han underviser i historie. I hope that makes it clearer.
As far as I can read Danish, I think lære can also mean to teach, see https://ordnet.dk/ddo/ordbog?select=l%C3%A6re,2&query=l%C3%A6re point 2):
bibringe kundskaber eller færdigheder, især i forbindelse med undervisning
Se også undervise
Anyway, I don't know if and how it would be used in combination with a matter, like history.