Believe it or not, there's actually a precise formula and set of rules that pre-determines the NFL regular season schedule for all 32 teams, for any given year, and it works on rotation. Under current design, a complete rotation takes 8 full seasons, meaning that it takes 8 years for every NFL team to have the opportunity to both host and visit every single other NFL team in the league.
Way it works is that the NFL consists of 32 teams. That breaks down to 2 conferences: the AFC and the NFC, with 16 teams each. Within both conferences, there are 4 divisions per conference, comprising of 4 teams per division.
And here's the breakdown of how they play each other, on rotation:
1) Each team plays twice against each of the other three teams within its own division: once at home, and once on the road ( totaling six games). This matchup of intra-division opponents is a constant every season. So, since I'm a Dallas Cowboy's fan, my example would be that the Cowboys play every team in their division (the NFC East) twice every single season: Washington, Philadelphia, and the New York Giants.
2) Each team also plays once against each of the four teams from another division within its own conference, with the assigned division based on a three-year rotation: two at home, and two on the road (four games). So, sticking with Cowboys, that means that there are 3 other divisions within the NFC conference, being the NFC West, NFC North and NFC South. Every year they rotate and play all 4 teams from one of those divisions.
3) Each team plays once against one team from each of the other two divisions within its conference, based on the final division standings from the prior season: one at home, one on the road (two games). For example, the Cowboys of course play 6 games total in their NFC East division, then they play 4 total with a rotating division, and then 2 more games against one of the two remaining divisions, depending upon the prior year standings.
4) Each team plays once against each of the four teams from a division in the other conference, with the assigned division based on a four-year rotation: two at home, and two on the road (four games). This is similar to #2 rule, except from a different conference. So, the Cowboys will play in rotation every year all four teams from a division from the AFC, either being the AFC North, West, East or South.
Every team follows these same four rules in rotation, and that comprises of a full 16 game season. Since there are 4 divisions per conference, and with regards to rules #2 and #4 where you host twice and visit twice, for teams to fully make a complete rotation, it takes 8 seasons to accomplish this.
Check out this link to see how the 2014-2017 Scheduled division match-ups
And last but not least check out the full 2014 NFL Regular Season schedule
here, courtesy of NFL.com.