For a nonprofit to be tax-exempt, it must be organized and operated according to section 501(c)(3) of the Internal Revenue Code. Generally, these are charitable organizations whose earnings are not distributed to shareholders.