Hi, Grant. There are too many local conditions to guarantee 50 years but you can do some things to help your chances.
One thing is to put 4-6" of gravel in the bottom of the hole. This will let any water that does get in drain away.
Also important is buying galvanized tubing. Most galvanized tubing is only totally galvanized on the outside and the tubing is bare on the inside in the weld area. Get hot dipped galvanized, if possible, but it may be hard to find.
Pick a size for which a cap is available. Fence suppliers have metal caps for round tubing in a few sizes. If you choose one of these sizes and apply the caps, you will increase your chances. Otherwise, figure out another way to keep water out of the top. If you use square tubing and have a table saw, you could make acceptable caps out of pressure treated wood. Be sure that you wear your dust mask when sawing pressure treated wood. Tubing of this type has some pretty wide tolerances so you might end up almost custom fitting the caps to each post.
Depending on the frost line in your area, 2 feet may or may not be deep enough to prevent frost heaving of the posts. Or the rest of your fence design may be such that frost heaving does not matter. One other rule of thumb is to have 1/3rd of the length of a post in the ground. Again, local soil and weather conditions are factors.
Applying all these suggestions may or may not let your fence last 50 years, but the more you apply, the better your chances will be.
Good luck and post in 50 years to let us know. LOL