Please see Table 2, starting on page 36, from IRS Publication 901, U.S. Tax Treaties (Rev.May 2004). The table lists the different types of payments that may be fully or partially exempt from U.S. income taxation to foreign nationals.
The number in the “Code” column is the same code number reflected on Form 1042S.
The number in the “Treaty Article Citation” column is the number that should be inserted on Form 8233