The present invention provides a 2-cyanopyrimidin-4-yl carbamate or urea derivative or a pharmaceutically acceptable salt thereof, a method for preparing same, and a pharmaceutical composition including same. The 2-cyanopyrimidin-4-yl carbamate or urea derivative or a pharmaceutically acceptable salt thereof selectively inhibits cathepsin K, and thus can be useful in the prevention or treatment of osteoporosis.