To get settled status, I need to be in the UK for at least 6 months every year. Do the 6 months need to be in a row or can they be spread out throughout the year?

To get settled status, you need to be residing in the UK for at least 6 months in any 12 month period for a total of 5 years. It does not matter if you take multiple trips outside of the UK as long as this does not exceed 6 months in total over a 12 month period.

For more information and a handy absence calculator see https://www.the3million.org.uk/absence-calculator