How to export a video in expecific ratio
Go to your sequence settings Sequence>Settings and change the resolution to match the size of the rectangle you want. 



When you want to export the media, in the export settings click the button in the video tab that says Match Source, this will set the export resolution to match your timeline. Some codecs (e.g. avid DNxHD) will not allow non-standard resolutions, and most will only allow even numbers of pixels in either dimension (e.g. h.264) so you may have to change codec.