Also, I have rebuild the index and I checked to make sure that all index and stats were same as in the old sql 2012 machine.
sELECT name AS index_name,STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated
FROM sys.indexes where STATS_DATE(OBJECT_ID, index_id) is not NULL
order by STATS_DATE(OBJECT_ID, index_id) desc
I also ran this query to make sure of any configuration diff:
SELECT * FROM sys.configurations
where value_in_use = 1
ORDER BY name ;
Also, I said above, I set the Legacy Cardinality Estimation in both tempdb and main DB to True. they way data files are organized in both 2012 ans 2016 are the same as well.