A little more than two years after the end of Captain America: Civil War, and prior to the snap in Avengers: Infinity War.
At the end of the movie, Scott Lang has just finished serving his two-year sentence under house arrest, meaning that the movie's end occurred a little (to allow for sentencing, etc.) over two years after the end of Captain America: Civil War. It also must have occurred prior to the snap in Avengers: Infinity War, as the results of the snap are portrayed later in the mid-credits sequence.
Your real question, though, is why Scott Lang was never called in during the events of Avengers: Infinity War, since according to this timeline he should already have been free by the point when Cap's faction reunites with Rhodey and Banner. But this is Romanoff's actual line:
After the whole Accords situation, he and Scott took a deal. It's too tough on their families. (Avengers: Infinity War)
In other words, they never explicitly say that they aren't calling Barton and Lang in because they're under house arrest, merely that they aren't calling them in because they "took a deal." Even though Scott Lang was no longer under house arrest by this point, he's still under probation and was presumably not in contact with either Cap's faction (who were still fugitives) or the official, Accords-sanctioned Avengers (whom he had no ties with to begin with).