Deductions & credits

I can't figure out how I'm eligible to exclude foreign income. Basically if you aren't in the US for 300 something days?