Shopify Flow inserts all data in one row in Google Sheets

Your liquid is looping over the order.lineitems instead of the lineItems from the loop.

Click “Add a variable”, choose the lineItem from the for each loop, and then the values you want. Once you see the syntax, it should be easy to adjust the rest. You shouldn’t need to loop over the lineItems any more, so it should be a bit simpler