If you purchase a firearm from a Federal Firearms License dealer (which you'll have to do if it is a new weapon) you will out a form 4473. That records the transfer for the dealer's records.
On the form there are three possible choices: Long gun (rifle or shotgun), handgun, or "Firearm." If your weapon comes to you with a shoulder stock attached, it will transfer as a long gun. Further, it cannot ever be configured as less than 26" overall, or with a barrel of less than 16" without first registering it as an SBR (technically, a "firearm made from a rifle").
If it comes to you without a buttstock, and with a barrel, but less than 26" overall, it will transfer as a handgun. Thanks to the recent ATF ruling, you can then make it into a rifle if you want, and then take it back to pistol configuration. (Previously, this would be a felony. If you made it into a rifle, it was ALWAYS a rifle and required registering it as a Title II firearm.)
If it comes to you as a stripped receiver, it will transfer as a "Firearm" (like a PGO shotgun does, or a belt-fed semi-auto M1919), and you can built it into either a long gun or a handgun as you wish.
A careful reading of the ATF's ruling indicates that if you want the flexibility to build it back and forth (handgun ---> rifle ---> handgun, etc.) you should start by building it as a handgun. Could that ever be enforced against you if you didn't? Heck, I don't know. But there's lots of federal felonies related to gun building (and transferring, and just about everything else) that might be hard to believe would be enforced -- but we follow the law.