The deal is pending the completion of a physical, a source said.
McLouth's deal, which was earlier reported by Foxsports.com and the Baltimore Sun, includes a $6.5 million club option for a third year that could increase the overall value of the package to $17.25 million.
McLouth, 32, is a .250 career hitter with 100 homers in nine seasons with Pittsburgh, Atlanta and Baltimore.
He hit .258 with 12 homers and a career-high 30 stolen bases in 146 games as Baltimore's principal left fielder this past season.
McLouth has played all three outfield positions in the major leagues, and brings depth to a Nationals outfield that consists of Bryce Harper in left field, Denard Span in center and Jayson Werth in right.
The Nationals, who finished 10 games behind Atlanta with an 86-76 record last season, upgraded their rotation with a trade for Detroit's Doug Fister earlier this week. General manager Mike Rizzo is also looking to add a left-handed reliever, with Scott Downs, J.P. Howell, Eric O'Flaherty, Oliver Perez and Boone Logan among the free-agent options reportedly being considered by the club.