It happened at about 23:40 BST on Monday in Galliagh Park.
Residents told the BBC they saw three masked and armed men enter the house.
A police spokesperson called the shooting a "brutal attack".
The man was taken Altnagelvin Hospital where his injuries are not believed to be life threatening.
A 44-year-old man is undergoing surgery after being shot in both legs in Londonderry.