As per Upwork Help & Support / Use Connects page,
Connects may be returned under the following circumstances:
- If a project is canceled by the client without making a hire, the Connects used on that proposal will be returned to you for reuse. This does not apply to expired job posts.
- If a job post has been removed by Upwork for a Terms of Service violation, the Connects used on that proposal will be returned for you to reuse
Note: Withdrawing your proposal will not return your Connects.