By guide:
If your sources have multiple channels with the same guide data, on the lowest numbered channel will display in the guide.
For example, many cable providers might broadcast the local ABC on channel 7 (which is where OTA users might expect the channel to be), but also list the same channel as 707. In this case, your guide would only show an entry for channel 7; channel 707 would not be displayed in the guide at all. If you attempted to tune channel 7, but there was an issue, the client would then attempt to tune 707.
By number:
If you have multiple sources that contain channels with the same numbers, then their entries will be consolidated into a single line in the guide. (Beware, if you have 2 different sources that have different content, but share a number, only one of those channels will appear in the guide.)
It should also be noted, this is only for the clients; the web UI does not do stacking. Also, how the DVR schedules passes is a slightly different process.