About “dropping” a weapon after an attack

Let’s say that after making an attack with my lance by stabbing it into an enemy, I leave the lance there (stab it into the enemy and just let go). Is this considered dropping the lance? And as such, am I able to take out my longsword and attack with it (Fighter lvl 6 has the Extra Attack class feature).