Hey Martin
In addition to Ross' suggestion, you can filter the output when exporting to CSV.
gam config csv_output_row_filter "'lastLoginTime:date<-365d'" redirect csv ./LastLogin.csv print users lastlogintime
However, setting the filter to over 365 days ago does count 'never' as over 365 days ago and you're reporting on all users including those that you might've already archived or ones that might not be logged into directly (like shared mailboxes). So you might want to filter by another field as well. So here's an example of users who haven't logged in in the last 365 days AND are not in the '_Terminated Staff' OU or any of its children.
gam config csv_output_row_filter "'lastLoginTime:date<-365d','orgUnitPath:notregex:/_Terminated Staff'" redirect csv ./LastLogin.csv print users lastlogintime ou
Aston