American history tells us that the party of the President regularly loses seats in the first, and all but once in the second (when it occurs) Presidential term of office.
The one major exception was 1934, when in the midst of the Great Depression, and FDR’s New Deal programs, the Democratic party gained 9 seats in the Senate and 9 seats in the House of Representatives.
Also, in 2002, after September 11, George W. Bush and the Republican Party gained 2 seats in the Senate and 8 in the House of Representatives.
And Bill Clinton and the Democratic Party, in the second term midterm election in 1998, gained 5 House seats, with no change in the US Senate.
That is the total historical record since the Civil War, more than 150 years, so it is clear that the Democrats will gain seats in the midterm elections of 2018.
The average since the Civil War is 32 House seats and 2 Senate seats, and if that happens precisely, the Democrats will have gained the House, needing only 24 seats, and the average historically being 23 seats, when one includes both first and second term midterm elections of a President.
But also, if the Senate were to see just the 2 seat gain as the average, then the Democrats would have the majority with 51 seats, which can be brought about by gaining the contested seats of Arizona, where Jeff Flake is retiring, and Nevada, where Dean Heller is seen as the most endangered Republican in 2018.
But to accomplish that, the Democrats must produce, miraculously. the retention of Senate seats in 10 Trump states in 2016–Missouri, North Dakota, Indiana, Montana, West Virginia, Florida, Pennsylvania, Wisconsin, Michigan, and Ohio, and also retain the Minnesota seat recently vacated by Al Franken, and the New Jersey Senate seat of Bob Menendez, who faces another criminal trial after a hung jury. That will be a tall order for sure!