This is why the terminology matters between firearms
In just about every discussion, precise terminology matters. Take the term 'troops,' for example. Both Soldiers and sailors fall under the 'troop' category, but they're drastically different. Even within sailors, a 'submariner' is very different from a 'Seabee.' When two types of troops have responsibilities that overlap, such as an Army combat engineer and a Navy Seabee, the preciseness of terminology is even more important to avoid confusion. Weapons also call for the same type of specific language, as there are many tools to fill similar — but not identical — roles.
Author's note: There are many classifications and categories of firearms. This is only meant to be a brief intro sprinkled with a dash of comedy. In the following article, there will be things missed and things discussed that don't have a universally accepted term — like a slug-barrelled, magazine-fed, semi-automatic shotgun which is totally not a rifle.
Anything can become a weapon in the right hands. Hell, as many of us know, a sandal is a terrifying weapon in the hands of an angry mother. This is also a perfect explanation for what constitutes an assault weapon. If your mother is wearing the sandal, it's just footwear. If your mother saw your sh*tty report card, she's now reaching for her "assault sandal." 'Assault' is just the descriptor for a weapon being used against someone.
Now, a weapon is only considered a firearm if it uses a burning propellant to cast a bullet, missile, or shell. This is the universally accepted term for everything ranging from a Howitzer to a pistol. Then there's the term 'gun.' Most people use this as the catch-all, but it's not. A gun is a weapon with shells or rounds manually-loaded into the chamber through a breach (or muzzle for older firearms). Typically, this term is used for crew-operated cannons, like field guns and artillery.
Some long guns (like muskets or light machine guns), most shotguns (especially breach-loaded ones), and some handguns (like revolvers) can be called guns and no one will bat an eye. These fall under either small arms (single-operator firearms) or light weapons (designed and typically team-operated). "Light weapons" includes your heavy machine guns and portable rocket launchers.
Easily the largest source of confusion, however, is the small arms category. A rifle gets its name from the helical pattern cut into bore wall (the rifling) of the barrel. Back when rifling was introduced on a musket, it was known as a "rifled gun." The rifling makes the round more accurate at further distances. It's the same reasoning behind throwing a football in a spiral.
Rifled barrels are used in a wide assortment of firearms, from small arms to crew-serviced weapons. Handguns can have them, and so can the aforementioned slug-barrelled shotguns. But without any other distinguishers, the term 'rifle' covers a huge categorical umbrella. It covers anything that's a single-user, magazine-fed firearm with a long, rifled barrel. Carbine is a fairly loose term, but it generally applies to rifles with shorter barrels.
To sum up the terminology used in today's firing ranges as Barney-style as possible: Call the firearm what it is. In general, a rifle is a firearm that only needs one operator. A gun is intended for two operators but can be used by one.
Fun fact: The term "assault rifle" comes from the German Sturmgewehr. It was named that because Hitler wanted his new weapon to sound more intimidating, even though it was nearly identical to other selective-fire rifles of the time. So yes, It is very much fascist German propaganda to call a rifle an "assault rifle" to make it more terrifying.