Foreign tax credit--what can I include as the basis?

I have a few foreign stocks, bought on US exchanges, and this year I have a foreign taxes paid amount. What can I include as the basis?

1) Can I include only dividends, not stock sales?

2) Can I include all foreign stock dividends, or only those that were specifically taxed?

3) Can I summarize the things I include as various and measure it against the whole tax amount, or do I need to separate out country by country or stock by stock?

Thanks in advance for anyone who can help me with this! So far my impression is that I can only include dividends, not sales, that I can only include dividends that were taxed, not all foreign dividends, and that I can show the countries as various and measure it against the whole tax amount. (For reference, the foreign tax amount is about $900, it appears I have one or two stocks that were taxed, and I have 4 or 5 foreign domiciled stocks.)