Yael,
For US, you want to be outside the country for 330 days OR a bona fide resident of another country. Under the 330 day rule, it doesn't matter what or where, as long as it ain't USA. Under the bona fide residence test, you must meet the definition of UK resident for the entire period.
For UK, residency is >180 days in the UK during a UK tax year. There are other definitions with other day restrictions as well; for purposes of this discussion, that's the important factor.
Thus, if you arrived in the UK late in the UK tax year, you might be UK nonresident, so you would have to meet the 330 day test instead.
Most people use the 330 day rule for the first year and bona fide residence thereafter. You may prefer to seek additional paid help if the rules and regulations are causing you frustration and grief.