Your plan administrator should have written information about your particular plan that explains when you can borrow funds from your 401(k) plan as well as other plan rules.
Typically when you leave the employer, any outstanding loans become immediately due and payable (or subject to tax and possible 10% penalty if not repaid promptly). So anything you take out while not employed there would be considered a distribution, unless you roll that (plus the 10% withheld for taxes) into an IRA or other qualified plan within 60 days.