What determines whether two organisms belong to the same species?

If two organisms are capable of producing offspring in nature, the belong to the same species. However, some organisms are capable of crossbreeding but are not the same species.