How is U.S. involvement in Vietnam and soviet innvolvment in Afghanistan similar?

The United State's involvement in Vietnam and the Soviet Union is similar to Afghanistan because troops remained for years. Additionally, the United States was involved to ensure the protection of the citizens.