I’m assuming you want to export a Pencil2D project that you have into a video format playable with other applications. In that case, you need to go in the top menu to File > Export > Movie… A dialog will come up that allows you to choose where to export to and various other options. Once you click okay it will generate a video at the specified location which you can share with your friends, upload online, etc.
If you would prefer a gif format you can do the same thing but going to File > Export > Animated GIF. Gifs are good for looping animations without sound, but usually worse for any other situation.